try to do better

This commit is contained in:
arrelin
2026-02-12 18:43:36 +03:00
parent 3410786da7
commit 2f4e8af2a0
12 changed files with 439 additions and 52 deletions

View File

@@ -26,6 +26,7 @@ import type {
JoinFamilyResponse,
FamilyMember,
LeaveFamilyResponse,
ExpenseHistoryResponse,
} from '../types';
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || '';
@@ -120,6 +121,11 @@ export const expenseApi = {
getRemainingLimit: (familyId: number, categoryId: number) =>
apiClient.get<RemainingLimit>(`/families/${familyId}/categories/${categoryId}/remaining`),
getHistory: (familyId: number, categoryId: number, showArchive: boolean = false, sortOrder: string = 'desc') =>
apiClient.get<ExpenseHistoryResponse>(`/families/${familyId}/categories/${categoryId}/expenses/history`, {
params: { show_archive: showArchive, sort_order: sortOrder },
}),
};
export const shoppingItemApi = {