mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-25 07:23:59 +00:00
added api for po issue remark
This commit is contained in:
@@ -138,4 +138,33 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp
|
||||
|
||||
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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user