feat(expenses): add edit amount and due date for pending expenses

This commit is contained in:
Jose Selesan
2026-06-04 11:00:36 -03:00
parent 5b6ccf0fa6
commit 55098a7b95
10 changed files with 366 additions and 11 deletions

View File

@@ -154,6 +154,11 @@ export type PayExpenseInput = {
paymentDate?: string;
};
export type UpdateExpenseInput = {
amount: number;
dueDate: string;
};
export function getPeriodicExpenses(): Promise<PeriodicExpense[]> {
return fetcher<PeriodicExpense[]>("/api/periodic-expenses");
}
@@ -263,6 +268,13 @@ export function payExpense(
return mutator<Expense>(`/api/expenses/${id}/pay`, "PUT", data);
}
export function updateExpense(
id: number,
data: UpdateExpenseInput,
): Promise<Expense> {
return mutator<Expense>(`/api/expenses/${id}`, "PUT", data);
}
export type ImportResult = {
imported: number;
skipped: number;