แก้ create เป็น update เมนูทะเบียนประวัติ
This commit is contained in:
parent
fde5f8d90a
commit
f281ea0bc2
61 changed files with 193 additions and 147 deletions
|
|
@ -15,7 +15,10 @@ export class ProfileAvatarEmployeeTempController extends Controller {
|
|||
private avatarRepository = AppDataSource.getRepository(ProfileAvatar);
|
||||
|
||||
@Get("{profileEmployeeId}")
|
||||
public async getAvatarEmployee(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||
public async getAvatarEmployee(
|
||||
@Path() profileEmployeeId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");
|
||||
const lists = await this.avatarRepository.find({
|
||||
where: { profileEmployeeId },
|
||||
|
|
@ -24,8 +27,12 @@ export class ProfileAvatarEmployeeTempController extends Controller {
|
|||
}
|
||||
|
||||
@Get("select/{profileEmployeeId}/{id}")
|
||||
public async selectAvatarEmployee(@Path() profileEmployeeId: string, @Path() id: string, @Request() req: RequestWithUser) {
|
||||
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ตสTEMP
|
||||
public async selectAvatarEmployee(
|
||||
@Path() profileEmployeeId: string,
|
||||
@Path() id: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); //ไม่แน่ใจTEMP
|
||||
const result = await this.avatarRepository.findOneBy({ id: id });
|
||||
if (!result) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
|
@ -56,7 +63,7 @@ export class ProfileAvatarEmployeeTempController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Body() body: CreateProfileEmployeeAvatar,
|
||||
) {
|
||||
await new permission().PermissionCreate(req, "SYS_REGISTRY_TEMP");
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");
|
||||
const profile = await this.profileRepository.findOne({
|
||||
where: { id: body.profileEmployeeId },
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue