feat(expenses): Add delete expense endpoint and functionality
Implements the ability to delete an expense, including its associated items and shares. Also refactors the expense update logic to correctly handle share updates and adds the corresponding API endpoint and mock DB function.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
import {
|
||||
Condo, Family, Payment, AppSettings, User, AuthResponse,
|
||||
Ticket, TicketComment, ExtraordinaryExpense, Notice,
|
||||
@@ -327,6 +328,12 @@ export const CondoService = {
|
||||
});
|
||||
},
|
||||
|
||||
deleteExpense: async (id: string): Promise<void> => {
|
||||
return request(`/expenses/${id}`, {
|
||||
method: 'DELETE'
|
||||
});
|
||||
},
|
||||
|
||||
getExpenseAttachment: async (expenseId: string, attachmentId: string): Promise<any> => {
|
||||
return request(`/expenses/${expenseId}/attachments/${attachmentId}`);
|
||||
},
|
||||
@@ -342,4 +349,4 @@ export const CondoService = {
|
||||
body: JSON.stringify({ amount, notes: 'PayPal Payment' })
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user