Explorar el Código

+ deli 업데이트

송용우 hace 4 meses
padre
commit
a6e6899f67
Se han modificado 2 ficheros con 28 adiciones y 3 borrados
  1. 12 3
      backend/app/Controllers/Deli.php
  2. 16 0
      pages/view/common/deli/detail.vue

+ 12 - 3
backend/app/Controllers/Deli.php

@@ -355,16 +355,25 @@ class Deli extends ResourceController
                 return $this->respond([
                     'message' => "배송정보가 성공적으로 업데이트되었습니다.",
                     'updated_count' => $updatedCount,
-                    'errors' => $errors
+                    'errors' => $errors,
+                    'debug_logs' => $debugLogs
                 ], 200);
             } else {
                 $db->transRollback();
-                return $this->fail('업데이트할 수 있는 데이터가 없습니다.', 400);
+                return $this->fail([
+                    'message' => '업데이트할 수 있는 데이터가 없습니다.',
+                    'debug_logs' => $debugLogs,
+                    'errors' => $errors
+                ], 400);
             }
 
         } catch (\Exception $e) {
             $db->transRollback();
-            return $this->fail('배송정보 업데이트 중 오류가 발생했습니다: ' . $e->getMessage(), 500);
+            $debugLogs[] = 'Exception: ' . $e->getMessage();
+            return $this->fail([
+                'message' => '배송정보 업데이트 중 오류가 발생했습니다: ' . $e->getMessage(),
+                'debug_logs' => $debugLogs
+            ], 500);
         }
     }
 

+ 16 - 0
pages/view/common/deli/detail.vue

@@ -1153,6 +1153,14 @@
       return useAxios().post("/deli/updateDeliveryInfo", updateData);
     }, "배송정보를 업데이트하는 중...")
       .then((res) => {
+        console.log('배송정보 업데이트 응답:', res.data);
+        if (res.data.debug_logs) {
+          console.log('=== 디버그 로그 ===');
+          res.data.debug_logs.forEach((log, index) => {
+            console.log(`${index + 1}. ${log}`);
+          });
+          console.log('================');
+        }
         $toast.success(`${res.data.updated_count}건의 배송정보가 업데이트되었습니다.`);
 
         // 배송 관리 목록으로 이동
@@ -1167,6 +1175,14 @@
         });
       })
       .catch((error) => {
+        console.log('배송정보 업데이트 에러:', error);
+        if (error.response?.data?.debug_logs) {
+          console.log('=== 에러 디버그 로그 ===');
+          error.response.data.debug_logs.forEach((log, index) => {
+            console.log(`${index + 1}. ${log}`);
+          });
+          console.log('====================');
+        }
         const errorHandler = useErrorHandler();
         errorHandler.handleApiError(error, "배송정보 업데이트");
       });