แก้ create เป็น update เมนูทะเบียนประวัติ

This commit is contained in:
AdisakKanthawilang 2024-08-27 12:11:31 +07:00
parent fde5f8d90a
commit f281ea0bc2
61 changed files with 193 additions and 147 deletions

View file

@ -69,7 +69,10 @@ export class ProfileAddressEmployeeTempController extends Controller {
*
*/
@Get("{profileEmployeeId}")
public async detailProfileAddress(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
public async detailProfileAddress(
@Path() profileEmployeeId: string,
@Request() req: RequestWithUser,
) {
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
const getProfileAddress = await this.profileEmployeeRepo.findOne({
where: { id: profileEmployeeId },
@ -100,7 +103,7 @@ export class ProfileAddressEmployeeTempController extends Controller {
*/
@Get("history/user")
public async getProfileAddressHistoryUser(@Request() request: RequestWithUser) {
// await new permission().PermissionGet(request, "SYS_REGISTRY_TEMP");//ตสTEMP
// await new permission().PermissionGet(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
const profile = await this.profileEmployeeRepo.findOneBy({ keycloak: request.user.sub });
if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
@ -142,7 +145,10 @@ export class ProfileAddressEmployeeTempController extends Controller {
*
*/
@Get("history/{profileId}")
public async getProfileAddressHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
public async getProfileAddressHistory(
@Path() profileId: string,
@Request() req: RequestWithUser,
) {
await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");
const record = await this.profileAddressHistoryRepo.find({
where: { profileEmployeeId: profileId },