refactor: standardize code formatting and improve consistency across various components and API routes for enhanced readability and maintainability
This commit is contained in:
@@ -31,7 +31,7 @@ export async function POST() {
|
||||
headers: {
|
||||
"Cache-Control": "no-store",
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Error clearing categories:", error);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user