fix(lint): resolve eslint warnings, type errors and clean unused code
This commit is contained in:
@@ -2,7 +2,7 @@ import { NextResponse } from 'next/server';
|
||||
import type { NextRequest } from 'next/server';
|
||||
import { i18n } from './app/dictionaries';
|
||||
|
||||
function getLocale(request: NextRequest): string {
|
||||
function getLocale(): string {
|
||||
// Always return default locale for now (can be improved to read headers)
|
||||
return i18n.defaultLocale;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export function proxy(request: NextRequest) {
|
||||
);
|
||||
|
||||
if (pathnameIsMissingLocale) {
|
||||
const locale = getLocale(request);
|
||||
const locale = getLocale();
|
||||
return NextResponse.redirect(
|
||||
new URL(`/${locale}${pathname === '/' ? '' : pathname}`, request.url)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user