diff --git a/src/controllers/ProfileAvatarController.ts b/src/controllers/ProfileAvatarController.ts index 16537b06..717f65f5 100644 --- a/src/controllers/ProfileAvatarController.ts +++ b/src/controllers/ProfileAvatarController.ts @@ -164,8 +164,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 }); } } @@ -180,12 +180,4 @@ export class ProfileAvatarController extends Controller { return new HttpSuccess(); } - - // private async deleteFile(avatar: string, avatarName: string) { - // const url = process.env.API_URL + `/salary/file/${avatar}/${avatarName}`; - // console.log(url); - // try { - // await http.delete(url); - // } catch {} - // } } 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/controllers/ProfileAvatarEmployeeTempController.ts b/src/controllers/ProfileAvatarEmployeeTempController.ts index e26bd53f..da4a109f 100644 --- a/src/controllers/ProfileAvatarEmployeeTempController.ts +++ b/src/controllers/ProfileAvatarEmployeeTempController.ts @@ -154,8 +154,8 @@ export class ProfileAvatarEmployeeTempController 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 994fcfbe..aae4273f 100644 --- a/src/entities/Profile.ts +++ b/src/entities/Profile.ts @@ -58,14 +58,14 @@ export class Profile extends EntityBase { comment: "รูปถ่าย", default: null, }) - avatar: string; + avatar: string | null; @Column({ nullable: true, comment: "รูปถ่าย", default: null, }) - avatarName: string; + avatarName: string | null; @Column({ nullable: true, diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index 04f7923f..6db7190f 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -46,14 +46,14 @@ export class ProfileEmployee extends EntityBase { comment: "รูปถ่าย", default: null, }) - avatar: string; + avatar: string | null; @Column({ nullable: true, comment: "รูปถ่าย", default: null, }) - avatarName: string; + avatarName: string | null; @Column({ nullable: true, @@ -693,13 +693,13 @@ export class ProfileEmployee extends EntityBase { default: false, }) privacyCheckin: boolean; - + @Column({ comment: "สถานะยืนยัน privacyUser", default: false, }) privacyUser: boolean; - + @Column({ comment: "สถานะยืนยัน privacyMgt", default: false,