feat(expenses): add edit amount and due date for pending expenses
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user