api client refactor
This commit is contained in:
12
apps/website/lib/services/payments/PaymentService.ts
Normal file
12
apps/website/lib/services/payments/PaymentService.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user