Skip to content

Commit

Permalink
fix: error code for participant not enrolled
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-carlos-sousa committed Sep 25, 2024
1 parent 99e667c commit 588d9ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/QuestApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function give(Request $request, Quest $quest): JsonResponse
return response()->json([
'status' => 'error',
'message' => 'Participant not enrolled in this edition!',
], 400);
], 412);
}

try {
Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/QuestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function give(Request $request, Quest $quest)
$request->validate([
'quest_code' => 'required|exists:participants,quest_code',
]);

$edition = $request->input('edition');
$participant = Participant::firstWhere('quest_code', $request->get('quest_code'));
$enrollment = $participant->enrollments()->where('edition_id', $edition?->id)->first();
Expand Down

0 comments on commit 588d9ea

Please sign in to comment.