harden media
This commit is contained in:
@@ -166,6 +166,16 @@ export class MediaService {
|
||||
async updateAvatar(driverId: string, input: UpdateAvatarInput): Promise<UpdateAvatarOutputDTO> {
|
||||
this.logger.debug(`[MediaService] Updating avatar for driver: ${driverId}`);
|
||||
|
||||
// Handle null avatarUrl - this would mean removing the avatar
|
||||
if (input.avatarUrl === null) {
|
||||
// For now, we'll treat null as an error since the use case requires a URL
|
||||
// In a complete implementation, this would trigger avatar removal
|
||||
return {
|
||||
success: false,
|
||||
error: 'Avatar URL cannot be null',
|
||||
};
|
||||
}
|
||||
|
||||
const result = await this.updateAvatarUseCase.execute({
|
||||
driverId,
|
||||
mediaUrl: input.avatarUrl,
|
||||
|
||||
Reference in New Issue
Block a user