merge dev into features/notifications

This commit is contained in:
2026-01-11 23:09:57 +01:00
14 changed files with 1335 additions and 2185 deletions
+18 -2
View File
@@ -5,12 +5,12 @@ namespace App\Http\Controllers;
use App\Events\UserCreated;
use App\Models\Notification;
use App\Models\User;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use App\Services\GetRole;
use App\Services\UserService;
use Propaganistas\LaravelPhone\PhoneNumber;
@@ -90,7 +90,9 @@ class UserController extends Controller
try {
return response()->json(UserService::getData($id));
} catch(\Exception $e) {
} catch (ModelNotFoundException $e) {
return response()->json(['message' => 'Utilisateur non trouvé'], 404);
} catch (\Exception $e) {
Log::info($e->getMessage());
return response()->json(['message' => "Server error"], 500);
}
@@ -214,4 +216,18 @@ class UserController extends Controller
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);
}
}
}