Create getInvalidUser route

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2026-01-05 09:48:13 +01:00
parent 4c907c8ba5
commit 516ab77d58
4 changed files with 18 additions and 2 deletions
+14
View File
@@ -196,4 +196,18 @@ class UserController extends Controller
return response()->json(['message' => "Server error"], 500); return response()->json(['message' => "Server error"], 500);
} }
} }
public function getInvalidUsers(Request $request): JsonResponse {
try {
$users = User::where('validate', 0)->pluck('id');
return response()->json($users);
} catch (\Exception $e) {
Log::info($e->getMessage());
return response()->json(['message' => "Server error"], 500);
}
}
} }
+2
View File
@@ -43,3 +43,5 @@ Route::post("/users/{id}/create/notification", [NotificationsController::class,
Route::middleware(['web', 'auth:sanctum'])->get('/users/search', [SearchController::class, "searchUsers"]); Route::middleware(['web', 'auth:sanctum'])->get('/users/search', [SearchController::class, "searchUsers"]);
Route::middleware(['web', 'auth:sanctum'])->get('/users/invalid', [UserController::class, "getInvalidUsers"]);
+1 -1
View File
@@ -11,7 +11,7 @@ get {
} }
vars:pre-request { vars:pre-request {
id: id: 2398
} }
settings { settings {
+1 -1
View File
@@ -1,4 +1,4 @@
headers { headers {
Accept: application/json Accept: application/json
X-XSRF-TOKEN: X-XSRF-TOKEN: eyJpdiI6Ik0vL3RZcUltSFZrd2hUM2ZDdzVpZUE9PSIsInZhbHVlIjoicmY2cTdHMmxVK0FzQXpncmNMVHpqWGVobWl5anhFN0xjajlQMG9qbEpCazVjQUgyQXJxRS9iZTdmVEd2VDF1V1AxU2czZG1uc1lOaUNVamRMOTRDcTd2WlloMlArZThEQ2FPSHpmbmpndS91eUZIS05Qa3JRcGduV3c5bXRQK3oiLCJtYWMiOiJhMjRjN2ZmMWFjZGE5YjQyODk1Zjg5YjZmZjIzZmZjZGJkYWNlMTI0OGVhNWRjODU5ZjZmNmE4NDc3ZGQ3N2U3IiwidGFnIjoiIn0=
} }