no message

This commit is contained in:
Kittapath 2024-05-15 15:29:23 +07:00
parent b7ca6795cb
commit 9365c6c62e
4 changed files with 77 additions and 2 deletions

View file

@ -42,13 +42,16 @@ export class ProfileAvatarController extends Controller {
Object.assign(data, { ...body, ...meta });
await this.avatarRepository.save(data);
let avatar = `ทะเบียนประวัติ/โปรไฟล์/${profile.id}/profile-${data.id}`;
let avatar = `ทะเบียนประวัติ/โปรไฟล์/${profile.id}`;
let fileName = `profile-${data.id}`;
data.avatar = avatar;
data.avatarName = fileName;
await this.avatarRepository.save(data);
profile.avatar = avatar;
profile.avatarName = fileName;
await this.profileRepository.save(profile);
return new HttpSuccess(avatar);
return new HttpSuccess({ avatar: avatar, avatarName: fileName });
}
@Delete("{avatarId}")