diff --git a/routes/admin_work_flow.php b/routes/admin_work_flow.php index 1970d2cd..c5bb2a4e 100644 --- a/routes/admin_work_flow.php +++ b/routes/admin_work_flow.php @@ -108,9 +108,37 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp ]); })->name('fetch_model_attributes'); - - Route::post('/create-1688-login-issue-remark', function (Request $request) { + // Route::post('/create-1688-login-issue-remark', function (Request $request) { + // $validator = Validator::make($request->all(), [ + // 'booking_id' => 'required', + // 'remark' => 'required', + // 'user_id' => 'required', + // ]); + + // if ($validator->fails()) { + // throw new RequestValidationException($validator->messages()->first()); + // } + + // $booking = Booking::find($request->booking_id); + + // if (!$booking) { + // return jsonResponse(null, 'Booking not found', 404); + // } + + // $remark = new Remark([ + // 'commenter_id' => $request->user_id, + // 'content' => $request->remark, + // 'owner_type' => get_class($booking), + // 'owner_id' => $booking->id, + // ]); + + // $remark->save(); + + // return jsonResponse($remark, 'Remark created successfully', 201); + // })->name('create_1688_login_issue_remark'); + + Route::post('/create_issue_remark', function (Request $request) { $validator = Validator::make($request->all(), [ 'booking_id' => 'required', 'remark' => 'required', @@ -137,34 +165,5 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp $remark->save(); return jsonResponse($remark, 'Remark created successfully', 201); - })->name('create_1688_login_issue_remark'); - - Route::post('/create_approve_issue_remark', function (Request $request) { - $validator = Validator::make($request->all(), [ - 'booking_id' => 'required', - 'remark' => 'required', - 'user_id' => 'required', - ]); - - if ($validator->fails()) { - throw new RequestValidationException($validator->messages()->first()); - } - - $booking = Booking::find($request->booking_id); - - if (!$booking) { - return jsonResponse(null, 'Booking not found', 404); - } - - $remark = new Remark([ - 'commenter_id' => $request->user_id, - 'content' => $request->remark, - 'owner_type' => get_class($booking), - 'owner_id' => $booking->id, - ]); - - $remark->save(); - - return jsonResponse($remark, 'Remark created successfully', 201); - })->name('create_approve_issue_remark'); + })->name('create_issue_remark'); });