refacto: error and types

This commit is contained in:
Julien Froidefond
2025-02-27 21:59:14 +01:00
parent ea51ff53a9
commit 279f6c6e88
37 changed files with 800 additions and 684 deletions

View File

@@ -15,6 +15,7 @@ export async function GET() {
return NextResponse.json(
{
error: {
name: "Preferences fetch error",
code: error.code,
message: getErrorMessage(error.code),
},
@@ -25,6 +26,7 @@ export async function GET() {
return NextResponse.json(
{
error: {
name: "Preferences fetch error",
code: ERROR_CODES.PREFERENCES.FETCH_ERROR,
message: getErrorMessage(ERROR_CODES.PREFERENCES.FETCH_ERROR),
},
@@ -47,6 +49,7 @@ export async function PUT(request: NextRequest) {
return NextResponse.json(
{
error: {
name: "Preferences update error",
code: error.code,
message: getErrorMessage(error.code),
},
@@ -57,6 +60,7 @@ export async function PUT(request: NextRequest) {
return NextResponse.json(
{
error: {
name: "Preferences update error",
code: ERROR_CODES.PREFERENCES.UPDATE_ERROR,
message: getErrorMessage(ERROR_CODES.PREFERENCES.UPDATE_ERROR),
},