api client refactor
This commit is contained in:
16
apps/website/lib/services/drivers/DriverService.ts
Normal file
16
apps/website/lib/services/drivers/DriverService.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { api as api } from '../../api';
|
||||
import { presentDriversLeaderboard } from '../../presenters';
|
||||
import { DriverLeaderboardViewModel } from '../../view-models';
|
||||
|
||||
export async function getDriverLeaderboard(): Promise<DriverLeaderboardViewModel> {
|
||||
const dto = await api.drivers.getLeaderboard();
|
||||
return presentDriversLeaderboard(dto);
|
||||
}
|
||||
|
||||
export async function completeDriverOnboarding(input: any): Promise<any> {
|
||||
return await api.drivers.completeOnboarding(input);
|
||||
}
|
||||
|
||||
export async function getCurrentDriver(): Promise<any> {
|
||||
return await api.drivers.getCurrent();
|
||||
}
|
||||
Reference in New Issue
Block a user