no message

This commit is contained in:
Kittapath 2024-05-16 12:18:51 +07:00
parent 3ea5ec3486
commit 61899e8431
2 changed files with 27 additions and 21 deletions

View file

@ -70,18 +70,6 @@ export class ProfileAvatarController extends Controller {
Object.assign(data, { ...body, ...meta });
await this.avatarRepository.save(data);
let avatar = `ทะเบียนประวัติ/โปรไฟล์/${profile.id}`;
let fileName = `profile-${data.id}`;
data.isActive = true;
data.avatar = avatar;
data.avatarName = fileName;
await this.avatarRepository.save(data);
profile.avatar = avatar;
profile.avatarName = fileName;
await this.profileRepository.save(profile);
const _profile = await this.profileRepository.findOne({
where: { id: body.profileId },
relations: ["profileAvatars"],
@ -97,6 +85,18 @@ export class ProfileAvatarController extends Controller {
}),
);
await this.avatarRepository.save(data);
let avatar = `ทะเบียนประวัติ/โปรไฟล์/${profile.id}`;
let fileName = `profile-${data.id}`;
data.isActive = true;
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: avatar, avatarName: fileName });
}