14 lines
377 B
TypeScript
14 lines
377 B
TypeScript
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);
|
|
}
|