@daeryun/dr_components 0.9.48 → 0.9.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -180,17 +180,32 @@ const StepOne = () => {
180
180
  };
181
181
  const skipMutation = useMutation({
182
182
  mutationFn: (bodyData) => __awaiter(void 0, void 0, void 0, function* () {
183
- const response = yield fetch(`/api/lawfirm/app/user`, {
183
+ const marketingResponse = yield fetch(`/api/lawfirm/app/user/agree`, {
184
+ method: 'POST',
185
+ headers: { 'Content-Type': 'application/json' },
186
+ body: JSON.stringify({ marketing_agree: bodyData.marketing_agree })
187
+ });
188
+ if (!marketingResponse.ok) {
189
+ throw new Error('마케팅 동의 API 호출 실패');
190
+ }
191
+ const userResponse = yield fetch(`/api/lawfirm/app/user`, {
184
192
  method: 'PATCH',
185
193
  headers: {
186
194
  'Content-Type': 'application/json'
187
195
  },
188
- body: JSON.stringify(bodyData)
196
+ body: JSON.stringify({
197
+ name: bodyData.name,
198
+ phoneNumber: bodyData.phoneNumber,
199
+ uuid: bodyData.uuid
200
+ })
189
201
  });
190
- if (!response.ok) {
191
- throw new Error('API 호출 실패');
202
+ if (!userResponse.ok) {
203
+ throw new Error('사용자 정보 API 호출 실패');
192
204
  }
193
- return response.json();
205
+ return {
206
+ marketing: yield marketingResponse.json(),
207
+ user: yield userResponse.json()
208
+ };
194
209
  }),
195
210
  onSuccess: () => {
196
211
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
@@ -239,7 +254,8 @@ const StepOne = () => {
239
254
  skipMutation.mutate({
240
255
  name: loginData.name,
241
256
  phoneNumber: loginData.phoneNumber,
242
- uuid: loginData.uuid
257
+ uuid: loginData.uuid,
258
+ marketing_agree: loginData.marketing_agree
243
259
  });
244
260
  }
245
261
  catch (error) {
@@ -243,20 +243,37 @@ const StepOne = () => {
243
243
  };
244
244
 
245
245
  const skipMutation = useMutation({
246
- mutationFn: async (bodyData: { name: string; phoneNumber: string; uuid: string }) => {
247
- const response = await fetch(`/api/lawfirm/app/user`, {
246
+ mutationFn: async (bodyData: { name: string; phoneNumber: string; uuid: string; marketing_agree: number }) => {
247
+ const marketingResponse = await fetch(`/api/lawfirm/app/user/agree`, {
248
+ method: 'POST',
249
+ headers: { 'Content-Type': 'application/json' },
250
+ body: JSON.stringify({ marketing_agree: bodyData.marketing_agree })
251
+ });
252
+
253
+ if (!marketingResponse.ok) {
254
+ throw new Error('마케팅 동의 API 호출 실패');
255
+ }
256
+
257
+ const userResponse = await fetch(`/api/lawfirm/app/user`, {
248
258
  method: 'PATCH',
249
259
  headers: {
250
260
  'Content-Type': 'application/json'
251
261
  },
252
- body: JSON.stringify(bodyData)
262
+ body: JSON.stringify({
263
+ name: bodyData.name,
264
+ phoneNumber: bodyData.phoneNumber,
265
+ uuid: bodyData.uuid
266
+ })
253
267
  });
254
268
 
255
- if (!response.ok) {
256
- throw new Error('API 호출 실패');
269
+ if (!userResponse.ok) {
270
+ throw new Error('사용자 정보 API 호출 실패');
257
271
  }
258
272
 
259
- return response.json();
273
+ return {
274
+ marketing: await marketingResponse.json(),
275
+ user: await userResponse.json()
276
+ };
260
277
  },
261
278
  onSuccess: () => {
262
279
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
@@ -296,6 +313,7 @@ const StepOne = () => {
296
313
 
297
314
  window.location.href = '/login/sign/step_two';
298
315
  };
316
+
299
317
  const handleSkip = async () => {
300
318
  try {
301
319
  // session storage에서 login 정보 가져오기
@@ -318,7 +336,8 @@ const StepOne = () => {
318
336
  skipMutation.mutate({
319
337
  name: loginData.name,
320
338
  phoneNumber: loginData.phoneNumber,
321
- uuid: loginData.uuid
339
+ uuid: loginData.uuid,
340
+ marketing_agree: loginData.marketing_agree
322
341
  });
323
342
  } catch (error) {
324
343
  console.error('Session storage parsing error:', error);