1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-24 13:52:21 +01:00
fab-manager/app/frontend/src/javascript/api/payment-schedule.ts

23 lines
880 B
TypeScript
Raw Normal View History

import apiClient from './api-client';
import { AxiosResponse } from 'axios';
2021-02-04 17:00:02 +01:00
import { PaymentSchedule, PaymentScheduleIndexRequest, PaymentScheduleItem } from '../models/payment-schedule';
import wrapPromise, { IWrapPromise } from '../lib/wrap-promise';
export default class PaymentScheduleAPI {
async list (query: PaymentScheduleIndexRequest): Promise<Array<PaymentSchedule>> {
const res: AxiosResponse = await apiClient.post(`/api/payment_schedules/list`, query);
return res?.data;
}
2021-02-04 17:00:02 +01:00
async cashCheck(paymentScheduleItemId: number) {
const res: AxiosResponse = await apiClient.post(`/api/payment_schedules/items/${paymentScheduleItemId}/cash_check`);
return res?.data;
}
static list (query: PaymentScheduleIndexRequest): IWrapPromise<Array<PaymentSchedule>> {
const api = new PaymentScheduleAPI();
return wrapPromise(api.list(query));
}
}