refactor: standardize code formatting and improve consistency across various components and API routes for enhanced readability and maintainability

This commit is contained in:
Julien Froidefond
2025-12-10 14:28:05 +01:00
parent 299a66e6ff
commit f8919b19b3
19 changed files with 152 additions and 161 deletions

View File

@@ -64,7 +64,7 @@ export async function GET(request: NextRequest) {
console.error("Error fetching transactions:", error);
return NextResponse.json(
{ error: "Failed to fetch transactions" },
{ status: 500 }
{ status: 500 },
);
}
}
@@ -90,7 +90,7 @@ export async function POST(request: Request) {
console.error("Error creating transactions:", error);
return NextResponse.json(
{ error: "Failed to create transactions" },
{ status: 500 }
{ status: 500 },
);
}
}
@@ -103,7 +103,7 @@ export async function PUT(request: Request) {
const transaction: Transaction = await request.json();
const updated = await transactionService.update(
transaction.id,
transaction
transaction,
);
// Revalider le cache des pages
@@ -120,7 +120,7 @@ export async function PUT(request: Request) {
console.error("Error updating transaction:", error);
return NextResponse.json(
{ error: "Failed to update transaction" },
{ status: 500 }
{ status: 500 },
);
}
}
@@ -136,7 +136,7 @@ export async function DELETE(request: Request) {
if (!id) {
return NextResponse.json(
{ error: "Transaction ID is required" },
{ status: 400 }
{ status: 400 },
);
}
@@ -153,7 +153,7 @@ export async function DELETE(request: Request) {
headers: {
"Cache-Control": "no-store",
},
}
},
);
} catch (error) {
console.error("Error deleting transaction:", error);