Refactor admin actions and improve code formatting: Standardize import statements, enhance error handling messages, and apply consistent formatting across event, user, and preference management functions for better readability and maintainability.
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled
This commit is contained in:
@@ -7,11 +7,16 @@ export async function GET() {
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user?.id) {
|
||||
return NextResponse.json({ error: "Vous devez être connecté" }, { status: 401 });
|
||||
return NextResponse.json(
|
||||
{ error: "Vous devez être connecté" },
|
||||
{ status: 401 }
|
||||
);
|
||||
}
|
||||
|
||||
// Récupérer tous les défis de l'utilisateur
|
||||
const challenges = await challengeService.getUserChallenges(session.user.id);
|
||||
const challenges = await challengeService.getUserChallenges(
|
||||
session.user.id
|
||||
);
|
||||
|
||||
return NextResponse.json(challenges);
|
||||
} catch (error) {
|
||||
@@ -22,4 +27,3 @@ export async function GET() {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user