mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 16:03:21 +00:00
chore: application prettier
This commit is contained in:
@ -9,7 +9,11 @@ const withLocale = (next) => {
|
||||
const { pathname, search } = request.nextUrl;
|
||||
|
||||
// Ignorer les ressources statiques et API routes
|
||||
if (pathname.startsWith('/_next') || pathname.startsWith('/api') || pathname.includes('.')) {
|
||||
if (
|
||||
pathname.startsWith('/_next') ||
|
||||
pathname.startsWith('/api') ||
|
||||
pathname.includes('.')
|
||||
) {
|
||||
return next(request, event);
|
||||
}
|
||||
|
||||
@ -21,7 +25,9 @@ const withLocale = (next) => {
|
||||
|
||||
// Si pas de locale dans l'URL, rediriger vers /fr
|
||||
if (!pathname.startsWith('/fr') && !pathname.startsWith('/en')) {
|
||||
return NextResponse.redirect(new URL(`/fr${pathname}${search}`, request.url));
|
||||
return NextResponse.redirect(
|
||||
new URL(`/fr${pathname}${search}`, request.url)
|
||||
);
|
||||
}
|
||||
|
||||
// Appliquer le middleware next-intl
|
||||
@ -39,4 +45,4 @@ const withLocale = (next) => {
|
||||
};
|
||||
};
|
||||
|
||||
export { withLocale };
|
||||
export { withLocale };
|
||||
|
||||
Reference in New Issue
Block a user