This commit is contained in:
AdisakKanthawilang 2024-08-27 14:19:04 +07:00
parent eb1e797354
commit 79b652d628
9 changed files with 32 additions and 32 deletions

View file

@ -103,7 +103,6 @@ export class ProfileAddressEmployeeTempController extends Controller {
*/ */
@Get("history/user") @Get("history/user")
public async getProfileAddressHistoryUser(@Request() request: RequestWithUser) { public async getProfileAddressHistoryUser(@Request() request: RequestWithUser) {
// await new permission().PermissionGet(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
const profile = await this.profileEmployeeRepo.findOneBy({ keycloak: request.user.sub }); const profile = await this.profileEmployeeRepo.findOneBy({ keycloak: request.user.sub });
if (!profile) { if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");

View file

@ -32,7 +32,7 @@ export class ProfileAvatarEmployeeTempController extends Controller {
@Path() id: string, @Path() id: string,
@Request() req: RequestWithUser, @Request() req: RequestWithUser,
) { ) {
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); //ไม่แน่ใจTEMP // await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); //ไม่แน่ใจTEMPปิดไว้ก่อน
const result = await this.avatarRepository.findOneBy({ id: id }); const result = await this.avatarRepository.findOneBy({ id: id });
if (!result) { if (!result) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");

View file

@ -2285,7 +2285,7 @@ export class ProfileController extends Controller {
) { ) {
const _record = await this.profileRepo.findOneBy({ id: id }); const _record = await this.profileRepo.findOneBy({ id: id });
if (_record) { if (_record) {
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_OFFICER", _record.id); //ไม่แน่ใจOFF await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_OFFICER", _record.id);
} }
const exists = const exists =
!!body.citizenId && !!body.citizenId &&
@ -4838,7 +4838,7 @@ export class ProfileController extends Controller {
*/ */
@Get("profileid/retire/{year}") @Get("profileid/retire/{year}")
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) { async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFF // await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
const profiles = await this.profileRepo const profiles = await this.profileRepo
.createQueryBuilder("profile") .createQueryBuilder("profile")
.leftJoinAndSelect("profile.posLevel", "posLevel") .leftJoinAndSelect("profile.posLevel", "posLevel")

View file

@ -141,7 +141,7 @@ export class ProfileDutyController extends Controller {
if (!profile) { if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
} }
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id); //ไม่แน่ใจOFF await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id);
const data = new ProfileDuty(); const data = new ProfileDuty();

View file

@ -580,7 +580,8 @@ export class ProfileEmployeeController extends Controller {
* *
*/ */
@Post() @Post()
async createProfile(@Body() body: CreateProfileEmployee, @Request() request: RequestWithUser) { //ไม่แน่ใจEMP async createProfile(@Body() body: CreateProfileEmployee, @Request() request: RequestWithUser) {
//ไม่แน่ใจEMPปิดไว้ก่อน
if (await this.profileRepo.findOneBy({ citizenId: body.citizenId })) { if (await this.profileRepo.findOneBy({ citizenId: body.citizenId })) {
throw new HttpError( throw new HttpError(
HttpStatus.INTERNAL_SERVER_ERROR, HttpStatus.INTERNAL_SERVER_ERROR,
@ -1058,7 +1059,7 @@ export class ProfileEmployeeController extends Controller {
*/ */
@Get("{id}") @Get("{id}")
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) { async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id); //ไม่แน่ใจEMP await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id);
const profile = await this.profileRepo.findOne({ const profile = await this.profileRepo.findOne({
relations: { relations: {
posLevel: true, posLevel: true,
@ -2659,7 +2660,7 @@ export class ProfileEmployeeController extends Controller {
*/ */
@Get("profileid/retire/{year}") @Get("profileid/retire/{year}")
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) { async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", id);//ไม่แน่ใจEMP // await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", id);//ไม่แน่ใจEMPปิดไว้ก่อน
const profiles = await this.profileRepo const profiles = await this.profileRepo
.createQueryBuilder("profileEmployee") .createQueryBuilder("profileEmployee")
.leftJoinAndSelect("profileEmployee.posLevel", "posLevel") .leftJoinAndSelect("profileEmployee.posLevel", "posLevel")
@ -2862,7 +2863,7 @@ export class ProfileEmployeeController extends Controller {
where: { id: id }, where: { id: id },
}); });
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_EMP", profile.id); await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_EMP", profile.id);//ไม่แน่ใจEMPปิดไว้ก่อน
profile.isLeave = requestBody.isLeave; profile.isLeave = requestBody.isLeave;
profile.leaveReason = requestBody.leaveReason; profile.leaveReason = requestBody.leaveReason;

View file

@ -1056,7 +1056,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("{id}") @Get("{id}")
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) { async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); //ไม่แน่ใจTEMP await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
const profile = await this.profileRepo.findOne({ const profile = await this.profileRepo.findOne({
relations: { relations: {
posLevel: true, posLevel: true,
@ -2075,7 +2075,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() id: string, @Path() id: string,
@Body() body: UpdatePositionTempProfileEmployee, @Body() body: UpdatePositionTempProfileEmployee,
) { ) {
// await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
if (body.posLevelId === "") body.posLevelId = null; if (body.posLevelId === "") body.posLevelId = null;
if (body.posTypeId === "") body.posTypeId = null; if (body.posTypeId === "") body.posTypeId = null;
@ -2555,7 +2555,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("keycloak/position/{revisionId}") @Get("keycloak/position/{revisionId}")
async getProfileByKeycloakByRevision( async getProfileByKeycloakByRevision(
//ไม่แน่ใจTEMP //ไม่แน่ใจTEMPปิดไว้ก่อน
@Path() revisionId: string, @Path() revisionId: string,
@Request() request: { user: Record<string, any> }, @Request() request: { user: Record<string, any> },
) { ) {
@ -2657,7 +2657,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("profileid/retire/{year}") @Get("profileid/retire/{year}")
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) { async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profiles = await this.profileRepo const profiles = await this.profileRepo
.createQueryBuilder("profileEmployee") .createQueryBuilder("profileEmployee")
.leftJoinAndSelect("profileEmployee.posLevel", "posLevel") .leftJoinAndSelect("profileEmployee.posLevel", "posLevel")
@ -2856,7 +2856,7 @@ export class ProfileEmployeeTempController extends Controller {
requestBody: { isLeave: boolean; leaveReason: string; dateLeave: Date }, requestBody: { isLeave: boolean; leaveReason: string; dateLeave: Date },
@Request() request: { user: Record<string, any> }, @Request() request: { user: Record<string, any> },
) { ) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profile = await this.profileRepo.findOne({ const profile = await this.profileRepo.findOne({
where: { id: id }, where: { id: id },
}); });
@ -2891,7 +2891,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() profileEmployeeId: string, @Path() profileEmployeeId: string,
@Body() body: UpdateInformationProfileEmployee, @Body() body: UpdateInformationProfileEmployee,
) { ) {
// await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profileEmp = await this.profileRepo.findOneBy({ id: profileEmployeeId }); const profileEmp = await this.profileRepo.findOneBy({ id: profileEmployeeId });
if (!profileEmp) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้"); if (!profileEmp) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
@ -2920,7 +2920,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("information/{profileEmployeeId}") @Get("information/{profileEmployeeId}")
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) { async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profileInformation = await this.profileRepo.findOne({ const profileInformation = await this.profileRepo.findOne({
where: { id: profileEmployeeId }, where: { id: profileEmployeeId },
}); });
@ -2951,7 +2951,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("information/history/{profileEmployeeId}") @Get("information/history/{profileEmployeeId}")
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) { async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profileInformation = await this.profileRepo.find({ const profileInformation = await this.profileRepo.find({
relations: { relations: {
information_histories: true, information_histories: true,
@ -2996,7 +2996,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() profileEmployeeId: string, @Path() profileEmployeeId: string,
@Request() req: RequestWithUser, @Request() req: RequestWithUser,
) { ) {
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employment = await this.employmentRepository.find({ const employment = await this.employmentRepository.find({
where: { profileEmployeeId: profileEmployeeId }, where: { profileEmployeeId: profileEmployeeId },
order: { createdAt: "ASC" }, order: { createdAt: "ASC" },
@ -3018,7 +3018,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("employment/id/{id}") @Get("employment/id/{id}")
async GetEmploymentById(@Path() id: string, @Request() req: RequestWithUser) { async GetEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employment = await this.employmentRepository.findOne({ const employment = await this.employmentRepository.findOne({
where: { id: id }, where: { id: id },
}); });
@ -3034,7 +3034,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("employment/history/{id}") @Get("employment/history/{id}")
async GetHistoryEmploymentById(@Path() id: string, @Request() req: RequestWithUser) { async GetHistoryEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employmentHistory = await this.employmentHistoryRepository.find({ const employmentHistory = await this.employmentHistoryRepository.find({
where: { profileEmployeeEmploymentId: id }, where: { profileEmployeeEmploymentId: id },
order: { lastUpdatedAt: "ASC" }, order: { lastUpdatedAt: "ASC" },
@ -3055,7 +3055,7 @@ export class ProfileEmployeeTempController extends Controller {
@Body() body: CreateEmploymentProfileEmployee, @Body() body: CreateEmploymentProfileEmployee,
@Request() request: RequestWithUser, @Request() request: RequestWithUser,
) { ) {
// await new permission().PermissionCreate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionCreate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profile = await this.profileRepo.findOne({ const profile = await this.profileRepo.findOne({
where: { id: profileEmployeeId }, where: { id: profileEmployeeId },
}); });
@ -3091,7 +3091,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Delete("employment/{id}") @Delete("employment/{id}")
async DeleteEmployment(@Path() id: string) { async DeleteEmployment(@Path() id: string) {
// await new permission().PermissionDelete(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionDelete(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
await this.employmentHistoryRepository.delete({ await this.employmentHistoryRepository.delete({
profileEmployeeEmploymentId: id, profileEmployeeEmploymentId: id,
}); });
@ -3116,7 +3116,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() id: string, @Path() id: string,
@Body() body: UpdateEmploymentProfileEmployee, @Body() body: UpdateEmploymentProfileEmployee,
) { ) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employment = await this.employmentRepository.findOneBy({ id }); const employment = await this.employmentRepository.findOneBy({ id });
if (!employment) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); if (!employment) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -3146,7 +3146,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Post("report") @Post("report")
async sendReport(@Request() request: RequestWithUser, @Body() requestBody: { id: string[] }) { async sendReport(@Request() request: RequestWithUser, @Body() requestBody: { id: string[] }) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profiles = await this.profileRepo.find({ where: { id: In(requestBody.id) } }); const profiles = await this.profileRepo.find({ where: { id: In(requestBody.id) } });
const _profiles = await Promise.all( const _profiles = await Promise.all(
@ -3185,7 +3185,7 @@ export class ProfileEmployeeTempController extends Controller {
}, },
@Request() request: { user: Record<string, any> }, @Request() request: { user: Record<string, any> },
) { ) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
await Promise.all( await Promise.all(
body.result.map(async (v) => { body.result.map(async (v) => {
const profile = await this.profileRepo.findOne({ const profile = await this.profileRepo.findOne({
@ -3245,7 +3245,7 @@ export class ProfileEmployeeTempController extends Controller {
keyword?: string; keyword?: string;
}, },
) { ) {
// await new permission().PermissionPost(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionPost(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
let findProfile: any; let findProfile: any;
let total: any; let total: any;
const skip = (page - 1) * pageSize; const skip = (page - 1) * pageSize;
@ -3404,7 +3404,7 @@ export class ProfileEmployeeTempController extends Controller {
*/ */
@Get("profileid/position/{id}") @Get("profileid/position/{id}")
async getProfileByProfileid(@Request() req: RequestWithUser, @Path() id: string) { async getProfileByProfileid(@Request() req: RequestWithUser, @Path() id: string) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP // await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profile = await this.profileRepo.findOne({ const profile = await this.profileRepo.findOne({
where: { id: id }, where: { id: id },
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],

View file

@ -230,7 +230,7 @@ export class ProfileFamilyCoupleController extends Controller {
if (!profile) { if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
} }
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id); //ไม่แน่ใจOFF await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id);
familyCouple.coupleCitizenId = Extension.CheckCitizen(String(body.coupleCitizenId)); familyCouple.coupleCitizenId = Extension.CheckCitizen(String(body.coupleCitizenId));
familyCouple.createdUserId = req.user.sub; familyCouple.createdUserId = req.user.sub;
familyCouple.createdFullName = req.user.name; familyCouple.createdFullName = req.user.name;

View file

@ -216,7 +216,7 @@ export class ProfileFamilyFatherController extends Controller {
if (!profile) { if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
} }
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id); //ไม่แน่ใจOFF await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id);
familyFather.fatherCitizenId = Extension.CheckCitizen(String(body.fatherCitizenId)); familyFather.fatherCitizenId = Extension.CheckCitizen(String(body.fatherCitizenId));
familyFather.createdUserId = req.user.sub; familyFather.createdUserId = req.user.sub;
familyFather.createdFullName = req.user.name; familyFather.createdFullName = req.user.name;
@ -239,7 +239,7 @@ export class ProfileFamilyFatherController extends Controller {
@Body() body: UpdateProfileFamilyFather, @Body() body: UpdateProfileFamilyFather,
@Path() profileId: string, @Path() profileId: string,
) { ) {
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profileId); //ไม่แน่ใจOFF await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profileId);
const familyFather = await this.ProfileFamilyFather.findOneBy({ profileId: profileId }); const familyFather = await this.ProfileFamilyFather.findOneBy({ profileId: profileId });
if (!familyFather) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); if (!familyFather) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");

View file

@ -215,7 +215,7 @@ export class ProfileFamilyMotherController extends Controller {
if (!profile) { if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
} }
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id); //ไม่แน่ใจOFF await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id);
familyMother.motherCitizenId = Extension.CheckCitizen(String(body.motherCitizenId)); familyMother.motherCitizenId = Extension.CheckCitizen(String(body.motherCitizenId));
familyMother.createdUserId = req.user.sub; familyMother.createdUserId = req.user.sub;
familyMother.createdFullName = req.user.name; familyMother.createdFullName = req.user.name;
@ -238,7 +238,7 @@ export class ProfileFamilyMotherController extends Controller {
@Body() body: UpdateProfileFamilyMother, @Body() body: UpdateProfileFamilyMother,
@Path() profileId: string, @Path() profileId: string,
) { ) {
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profileId); //ไม่แน่ใจOFF await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profileId);
const familyMother = await this.ProfileFamilyMother.findOneBy({ profileId: profileId }); const familyMother = await this.ProfileFamilyMother.findOneBy({ profileId: profileId });
if (!familyMother) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); if (!familyMother) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");