api client refactor
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { api as api } from '../../api';
|
||||
import { presentDriverRegistrationStatus } from '../../presenters';
|
||||
import { DriverRegistrationStatusViewModel } from '../../view-models';
|
||||
|
||||
export async function getDriverRegistrationStatus(driverId: string): Promise<DriverRegistrationStatusViewModel> {
|
||||
// TODO: implement API call
|
||||
const dto = { driverId, status: 'pending' };
|
||||
return presentDriverRegistrationStatus(dto);
|
||||
}
|
||||
|
||||
export async function registerDriver(input: any): Promise<any> {
|
||||
// TODO: implement
|
||||
return {};
|
||||
}
|
||||
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