Add get user by id tasks

This commit is contained in:
T'JAMPENS QUENTIN p2406187 committed 2025-11-20 12:16:38 +01:00
1 parent d142979e49
commit feef269015
3 files changed
+32

No files matched your search

+10
View File
@@ -161,4 +161,14 @@ class UserController extends Controller
return response()->json(['message' => "Server error"], 500);
}
}
public function getUserByIdTasks(Request $request, int $id): JsonResponse {
try {
return response()->json(['data' => User::find($id)->tasks]);
} catch (\Exception $e) {
Log::info($e->getMessage());
return response()->json(['message' => "Server error"], 500);
}
}
}