diff --git a/src/controllers/ProfileAvatarController.ts b/src/controllers/ProfileAvatarController.ts index 099cdcb1..73374070 100644 --- a/src/controllers/ProfileAvatarController.ts +++ b/src/controllers/ProfileAvatarController.ts @@ -165,8 +165,8 @@ export class ProfileAvatarController extends Controller { where: { id: _record.profileId }, }); if (profile) { - profile.avatar = ""; - profile.avatarName = ""; + profile.avatar = null; + profile.avatarName = null; await this.profileRepository.save(profile, { data: req }); } } diff --git a/src/controllers/ProfileAvatarEmployeeController.ts b/src/controllers/ProfileAvatarEmployeeController.ts index 72c652f1..ac6c2ff0 100644 --- a/src/controllers/ProfileAvatarEmployeeController.ts +++ b/src/controllers/ProfileAvatarEmployeeController.ts @@ -160,8 +160,8 @@ export class ProfileAvatarEmployeeController extends Controller { where: { id: _record.profileEmployeeId }, }); if (profile) { - profile.avatar = ""; - profile.avatarName = ""; + profile.avatar = null; + profile.avatarName = null; await this.profileRepository.save(profile, { data: req }); } } diff --git a/src/entities/Profile.ts b/src/entities/Profile.ts index f5bdd6ce..8fc1275f 100644 --- a/src/entities/Profile.ts +++ b/src/entities/Profile.ts @@ -57,15 +57,17 @@ export class Profile extends EntityBase { nullable: true, comment: "รูปถ่าย", default: null, + type: "varchar", }) - avatar: string ; + avatar: string | null; @Column({ nullable: true, comment: "รูปถ่าย", default: null, + type: "varchar", }) - avatarName: string; + avatarName: string | null; @Column({ nullable: true, diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index e358304d..e73ca914 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -45,15 +45,17 @@ export class ProfileEmployee extends EntityBase { nullable: true, comment: "รูปถ่าย", default: null, + type: "varchar", }) - avatar: string; + avatar: string | null; @Column({ nullable: true, comment: "รูปถ่าย", default: null, + type: "varchar", }) - avatarName: string; + avatarName: string | null; @Column({ nullable: true,