Add get user task by id

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2025-11-21 11:08:11 +01:00
parent feef269015
commit 5e846a8896
2 changed files with 15 additions and 5 deletions
+10
View File
@@ -171,4 +171,14 @@ class UserController extends Controller
return response()->json(['message' => "Server error"], 500);
}
}
public function getUserTaskById(Request $request, int $idTask): JsonResponse {
try {
return response()->json(['data' => $request->user()->tasks->find($idTask)]);
} catch (\Exception $e) {
Log::info($e->getMessage());
return response()->json(['message' => "Server error"], 500);
}
}
}