fix api build issues
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import { Body, Controller, Get, Param, Post, Put, Req, Inject } from '@nestjs/common';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { Request } from 'express';
|
||||
|
||||
import { DriverService } from './DriverService';
|
||||
import { CompleteOnboardingInputDTO } from './dtos/CompleteOnboardingInputDTO';
|
||||
|
||||
type AuthenticatedRequest = {
|
||||
user?: { userId: string };
|
||||
};
|
||||
import { CompleteOnboardingOutputDTO } from './dtos/CompleteOnboardingOutputDTO';
|
||||
import { DriverRegistrationStatusDTO } from './dtos/DriverRegistrationStatusDTO';
|
||||
import { DriversLeaderboardDTO } from './dtos/DriversLeaderboardDTO';
|
||||
@@ -10,9 +14,6 @@ import { DriverStatsDTO } from './dtos/DriverStatsDTO';
|
||||
import { GetDriverOutputDTO } from './dtos/GetDriverOutputDTO';
|
||||
import { GetDriverProfileOutputDTO } from './dtos/GetDriverProfileOutputDTO';
|
||||
|
||||
interface AuthenticatedRequest extends Request {
|
||||
user?: { userId: string };
|
||||
}
|
||||
|
||||
@ApiTags('drivers')
|
||||
@Controller('drivers')
|
||||
@@ -53,7 +54,10 @@ export class DriverController {
|
||||
@Body() input: CompleteOnboardingInputDTO,
|
||||
@Req() req: AuthenticatedRequest,
|
||||
): Promise<CompleteOnboardingOutputDTO> {
|
||||
const userId = req.user!.userId;
|
||||
const userId = req.user?.userId;
|
||||
if (!userId) {
|
||||
throw new Error('Unauthorized');
|
||||
}
|
||||
return await this.driverService.completeOnboarding(userId, input);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { ITeamMembershipRepository } from '@core/racing/domain/repositories
|
||||
import type { ITeamRepository } from '@core/racing/domain/repositories/ITeamRepository';
|
||||
import { IDriverStatsService } from '@core/racing/domain/services/IDriverStatsService';
|
||||
import { IRankingService } from '@core/racing/domain/services/IRankingService';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger, UseCaseOutputPort } from '@core/shared/application';
|
||||
import type { ISocialGraphRepository } from '@core/social/domain/repositories/ISocialGraphRepository';
|
||||
|
||||
// Import use cases
|
||||
@@ -42,9 +42,6 @@ import { DriverRegistrationStatusPresenter } from './presenters/DriverRegistrati
|
||||
import { DriversLeaderboardPresenter } from './presenters/DriversLeaderboardPresenter';
|
||||
import { DriverStatsPresenter } from './presenters/DriverStatsPresenter';
|
||||
|
||||
// Import types for output ports
|
||||
import type { UseCaseOutputPort } from '@core/shared/application';
|
||||
|
||||
import {
|
||||
DRIVER_REPOSITORY_TOKEN,
|
||||
RANKING_SERVICE_TOKEN,
|
||||
|
||||
@@ -53,7 +53,9 @@ export class DriverProfilePresenter
|
||||
return this.responseModel;
|
||||
}
|
||||
|
||||
private getAvatarUrl(_driverId: string): string | undefined {
|
||||
private getAvatarUrl(driverId: string): string | undefined {
|
||||
void driverId;
|
||||
|
||||
// Avatar resolution is delegated to infrastructure; keep as-is for now.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user