mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
Replace in-memory store with database persistence
- Remove in-memory store and related tests - Add Decimal to number conversion in API responses - Update integration tests to handle Prisma Decimal type - Fix test configuration to only run db-integration tests
This commit is contained in:
@@ -5,7 +5,13 @@ export const GET: APIRoute = async ({ params }) => {
|
||||
try {
|
||||
const accountTransactions = await transactionService.getByAccountId(params.id as string);
|
||||
|
||||
return new Response(JSON.stringify(accountTransactions), {
|
||||
// Convert Decimal to number for each transaction in response
|
||||
const response = accountTransactions.map((transaction) => ({
|
||||
...transaction,
|
||||
amount: Number(transaction.amount),
|
||||
}));
|
||||
|
||||
return new Response(JSON.stringify(response), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user