no message
This commit is contained in:
parent
b7ca6795cb
commit
9365c6c62e
4 changed files with 77 additions and 2 deletions
|
|
@ -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}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue