Add get user's tasks route

This commit is contained in:
T'JAMPENS QUENTIN p2406187 committed 2025-11-20 11:23:56 +01:00
1 parent fd65cfdc1c
commit feb901c9e8
6 files changed
+47 -25

No files matched your search

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