Add get user by id tasks

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2025-11-20 12:16:38 +01:00
parent d142979e49
commit feef269015
3 changed files with 32 additions and 0 deletions
+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);
}
}
}