remove core from pages

This commit is contained in:
2025-12-18 19:14:50 +01:00
parent 9814d9682c
commit 4a3087ae35
35 changed files with 552 additions and 354 deletions

View File

@@ -54,10 +54,34 @@ export class DriverService {
}
/**
* Get driver profile with full details and view model transformation
*/
* Get driver profile with full details and view model transformation
*/
async getDriverProfile(driverId: string): Promise<DriverProfileViewModel> {
const dto = await this.apiClient.getDriverProfile(driverId);
return new DriverProfileViewModel(dto);
}
/**
* Update current driver profile with view model transformation
*/
async updateProfile(updates: { bio?: string; country?: string }): Promise<DriverProfileViewModel> {
const dto = await this.apiClient.updateProfile(updates);
// After updating, get the full profile again to return updated view model
return this.getDriverProfile(dto.id);
}
/**
* Find driver by ID
*/
async findById(id: string): Promise<DriverDTO | null> {
return this.apiClient.getDriver(id);
}
/**
* Find multiple drivers by IDs
*/
async findByIds(ids: string[]): Promise<DriverDTO[]> {
const drivers = await Promise.all(ids.map(id => this.apiClient.getDriver(id)));
return drivers.filter((d): d is DriverDTO => d !== null);
}
}