refactor driver module (wip)
This commit is contained in:
@@ -217,7 +217,7 @@ describe('MediaController', () => {
|
||||
describe('updateAvatar', () => {
|
||||
it('should update avatar and return result', async () => {
|
||||
const driverId = 'driver-123';
|
||||
const input = { mediaUrl: 'https://example.com/new-avatar.png' } as UpdateAvatarOutputDTO;
|
||||
const input: UpdateAvatarInputDTO = { avatarUrl: 'https://example.com/new-avatar.png' };
|
||||
const dto: UpdateAvatarOutputDTO = {
|
||||
success: true,
|
||||
};
|
||||
@@ -225,9 +225,9 @@ describe('MediaController', () => {
|
||||
|
||||
const res = createMockResponse();
|
||||
|
||||
await controller.updateAvatar(driverId, input as any, res);
|
||||
await controller.updateAvatar(driverId, input, res);
|
||||
|
||||
expect(service.updateAvatar).toHaveBeenCalledWith(driverId, input as any);
|
||||
expect(service.updateAvatar).toHaveBeenCalledWith(driverId, input);
|
||||
expect(res.status).toHaveBeenCalledWith(200);
|
||||
expect(res.json).toHaveBeenCalledWith(dto);
|
||||
});
|
||||
|
||||
@@ -92,7 +92,7 @@ export class MediaService {
|
||||
}
|
||||
|
||||
async uploadMedia(
|
||||
input: UploadMediaInput & { file: Express.Multer.File } & { userId?: string; metadata?: Record<string, any> },
|
||||
input: UploadMediaInput & { file: Express.Multer.File } & { userId?: string; metadata?: Record<string, unknown> },
|
||||
): Promise<UploadMediaOutputDTO> {
|
||||
this.logger.debug('[MediaService] Uploading media.');
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export class UpdateAvatarPresenter implements UseCaseOutputPort<UpdateAvatarResu
|
||||
this.model = null;
|
||||
}
|
||||
|
||||
present(result: UpdateAvatarResult): void {
|
||||
present(_result: UpdateAvatarResult): void {
|
||||
this.model = {
|
||||
success: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user