13 lines
467 B
TypeScript

import { api } from '@/shared/api/client';
import type { paths } from '@/shared/api/schema';
type ExpenseListPath = paths['/expenses/list/{id}']['get']['parameters']['path'];
type ExpenseListResponse = paths['/expenses/list/{id}']['get']['responses']['200']['content']['application/json'];
export async function getExpenseList(path: ExpenseListPath) {
const { data: result } = await api.get<ExpenseListResponse>(`/expenses/list/${path.id}`);
return result;
}