Refactor ESLint configuration and update code formatting: Standardize quotes in eslint.config.mjs, next.config.js, and various TypeScript files for consistency. Add Prettier as a dependency and include formatting scripts in package.json. Clean up unnecessary whitespace in multiple files to enhance code readability.
This commit is contained in:
@@ -45,4 +45,3 @@ export async function GET() {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,10 @@ export async function POST(request: Request) {
|
||||
const file = formData.get("file") as File;
|
||||
|
||||
if (!file) {
|
||||
return NextResponse.json({ error: "Aucun fichier fourni" }, { status: 400 });
|
||||
return NextResponse.json(
|
||||
{ error: "Aucun fichier fourni" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
// Vérifier le type de fichier
|
||||
@@ -55,4 +58,3 @@ export async function POST(request: Request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,21 +53,21 @@ export async function PUT(request: Request) {
|
||||
where: { id: "global" },
|
||||
update: {
|
||||
homeBackground:
|
||||
homeBackground === "" ? null : homeBackground ?? undefined,
|
||||
homeBackground === "" ? null : (homeBackground ?? undefined),
|
||||
eventsBackground:
|
||||
eventsBackground === "" ? null : eventsBackground ?? undefined,
|
||||
eventsBackground === "" ? null : (eventsBackground ?? undefined),
|
||||
leaderboardBackground:
|
||||
leaderboardBackground === ""
|
||||
? null
|
||||
: leaderboardBackground ?? undefined,
|
||||
: (leaderboardBackground ?? undefined),
|
||||
},
|
||||
create: {
|
||||
id: "global",
|
||||
homeBackground: homeBackground === "" ? null : homeBackground ?? null,
|
||||
homeBackground: homeBackground === "" ? null : (homeBackground ?? null),
|
||||
eventsBackground:
|
||||
eventsBackground === "" ? null : eventsBackground ?? null,
|
||||
eventsBackground === "" ? null : (eventsBackground ?? null),
|
||||
leaderboardBackground:
|
||||
leaderboardBackground === "" ? null : leaderboardBackground ?? null,
|
||||
leaderboardBackground === "" ? null : (leaderboardBackground ?? null),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ export async function PUT(
|
||||
// Si le niveau est modifié directement, utiliser cette valeur
|
||||
const targetLevel = Math.max(1, level);
|
||||
updateData.level = targetLevel;
|
||||
|
||||
|
||||
// Recalculer le maxXp pour le nouveau niveau
|
||||
// Formule: maxXp = 5000 * (1.2 ^ (level - 1))
|
||||
let calculatedMaxXp = 5000;
|
||||
@@ -107,7 +107,7 @@ export async function PUT(
|
||||
calculatedMaxXp = Math.floor(calculatedMaxXp * 1.2);
|
||||
}
|
||||
updateData.maxXp = calculatedMaxXp;
|
||||
|
||||
|
||||
// Réinitialiser l'XP si le niveau change directement (sauf si on modifie aussi l'XP)
|
||||
if (targetLevel !== user.level && xpDelta === undefined) {
|
||||
updateData.xp = 0;
|
||||
@@ -196,4 +196,3 @@ export async function DELETE(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,4 +41,3 @@ export async function GET() {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user