Merge branch 'develop' into dev

# Conflicts:
#	src/controllers/ProfileAvatarEmployeeController.ts
This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-01-30 17:39:31 +07:00
commit 217f9f64f9
3 changed files with 7 additions and 6 deletions

View file

@ -159,13 +159,14 @@ export class ProfileAvatarController extends Controller {
"SYS_REGISTRY_OFFICER", "SYS_REGISTRY_OFFICER",
_record.profileId, _record.profileId,
); );
if (_record.isActive) { if (_record.isActive) {
const profile = await this.profileRepository.findOne({ const profile = await this.profileRepository.findOne({
where: { id: _record.profileId }, where: { id: _record.profileId },
}); });
if (profile) { if (profile) {
profile.avatar = ''; profile.avatar = null;
profile.avatarName = ''; profile.avatarName = null;
await this.profileRepository.save(profile, { data: req }); await this.profileRepository.save(profile, { data: req });
} }
} }

View file

@ -160,8 +160,8 @@ export class ProfileAvatarEmployeeController extends Controller {
where: { id: _record.profileEmployeeId }, where: { id: _record.profileEmployeeId },
}); });
if (profile) { if (profile) {
profile.avatar = ''; profile.avatar = "";
profile.avatarName = ''; profile.avatarName = "";
await this.profileRepository.save(profile, { data: req }); await this.profileRepository.save(profile, { data: req });
} }
} }

View file

@ -58,14 +58,14 @@ export class Profile extends EntityBase {
comment: "รูปถ่าย", comment: "รูปถ่าย",
default: null, default: null,
}) })
avatar: string; avatar: string | null;
@Column({ @Column({
nullable: true, nullable: true,
comment: "รูปถ่าย", comment: "รูปถ่าย",
default: null, default: null,
}) })
avatarName: string; avatarName: string | null;
@Column({ @Column({
nullable: true, nullable: true,