Refactor code style for consistency in store and API route files

This commit is contained in:
GitHub Copilot
2025-04-23 21:39:50 -04:00
parent dfc4e23601
commit ae6886bf92
2 changed files with 40 additions and 40 deletions

View File

@@ -1,41 +1,41 @@
import type { Account, Transaction } from '../types'; import type { Account, Transaction } from "../types";
// Temporary in-memory store for development // Temporary in-memory store for development
export const accounts: Account[] = [ export const accounts: Account[] = [
{ {
id: '1', id: "1",
name: 'Checking Account', name: "Checking Account",
last4: '4321', last4: "4321",
balance: 2500.00 balance: 2500.0,
}, },
{ {
id: '2', id: "2",
name: 'Savings Account', name: "Savings Account",
last4: '8765', last4: "8765",
balance: 10000.00 balance: 10000.0,
} },
]; ];
export const transactions: Transaction[] = [ export const transactions: Transaction[] = [
{ {
id: '1', id: "1",
accountId: '1', accountId: "1",
date: '2025-04-20', date: "2025-04-20",
description: 'Grocery Store', description: "Grocery Store",
amount: -75.50 amount: -75.5,
}, },
{ {
id: '2', id: "2",
accountId: '1', accountId: "1",
date: '2025-04-21', date: "2025-04-21",
description: 'Salary Deposit', description: "Salary Deposit",
amount: 3000.00 amount: 3000.0,
}, },
{ {
id: '3', id: "3",
accountId: '2', accountId: "2",
date: '2025-04-22', date: "2025-04-22",
description: 'Transfer to Savings', description: "Transfer to Savings",
amount: 500.00 amount: 500.0,
} },
]; ];

View File

@@ -1,11 +1,11 @@
import type { APIRoute } from 'astro'; import type { APIRoute } from "astro";
import { accounts } from '../../../data/store'; import { accounts } from "../../../data/store";
export const GET: APIRoute = async () => { export const GET: APIRoute = async () => {
return new Response(JSON.stringify(accounts), { return new Response(JSON.stringify(accounts), {
status: 200, status: 200,
headers: { headers: {
'Content-Type': 'application/json' "Content-Type": "application/json",
} },
}); });
}; };