update controllers logic
This commit is contained in:
@@ -46,9 +46,14 @@ class AssignmentApiController extends Controller
|
||||
], 422);
|
||||
}
|
||||
|
||||
$userId = (int) ($request->user()?->id ?? 0);
|
||||
if ($userId <= 0) {
|
||||
return response()->json(['message' => 'Unauthorized.'], 401);
|
||||
}
|
||||
|
||||
$assignment = $this->assignmentService->storeAssignment(
|
||||
data: $validator->validated(),
|
||||
updatedBy: $request->user()?->id
|
||||
updatedBy: $userId
|
||||
);
|
||||
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user