mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
fix: Update fetch calls to use relative paths for API requests
This commit is contained in:
@@ -10,7 +10,7 @@ export interface Props {
|
||||
}
|
||||
|
||||
// Fetch accounts from API
|
||||
const accountsResponse = await fetch('http://localhost:4321/api/accounts');
|
||||
const accountsResponse = await fetch('/api/accounts'); // Use relative path
|
||||
const accounts: Account[] = await accountsResponse.json();
|
||||
|
||||
// Initialize with first account or empty account if none exist
|
||||
@@ -24,7 +24,7 @@ const initialAccount: Account = accounts[0] || {
|
||||
// Fetch initial transactions if we have an account
|
||||
let initialTransactions: Transaction[] = [];
|
||||
if (initialAccount.id) {
|
||||
const transactionsResponse = await fetch(`http://localhost:4321/api/accounts/${initialAccount.id}/transactions`);
|
||||
const transactionsResponse = await fetch(`/api/accounts/${initialAccount.id}/transactions`); // Use relative path
|
||||
initialTransactions = await transactionsResponse.json();
|
||||
}
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user