12 lines
484 B
TypeScript
12 lines
484 B
TypeScript
import { api as api } from '../../api';
|
|
import { presentPayment } from '../../presenters';
|
|
import { PaymentViewModel } from '../../view-models';
|
|
|
|
export async function getPayments(leagueId?: string, driverId?: string): Promise<PaymentViewModel[]> {
|
|
const dto = await api.payments.getPayments(leagueId, driverId);
|
|
return dto.payments.map(p => presentPayment(p));
|
|
}
|
|
|
|
export async function createPayment(input: any): Promise<any> {
|
|
return await api.payments.createPayment(input);
|
|
} |