feat: creats frontend for the project
This commit is contained in:
13
frontend/src/api/accounts.ts
Normal file
13
frontend/src/api/accounts.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Account, UpdateAccountRequest } from '@family-budget/shared';
|
||||
import { api } from './client';
|
||||
|
||||
export async function getAccounts(): Promise<Account[]> {
|
||||
return api.get<Account[]>('/api/accounts');
|
||||
}
|
||||
|
||||
export async function updateAccount(
|
||||
id: number,
|
||||
data: UpdateAccountRequest,
|
||||
): Promise<Account> {
|
||||
return api.put<Account>(`/api/accounts/${id}`, data);
|
||||
}
|
||||
Reference in New Issue
Block a user