permisstion ทะเบียนประวัติ(ที่ระบบอื่นๆ)

This commit is contained in:
Bright 2024-08-28 17:04:39 +07:00
parent ff8917195f
commit 4bee31e74e
18 changed files with 496 additions and 5 deletions

View file

@ -36,6 +36,18 @@ export class ProfileAvatarController extends Controller {
return new HttpSuccess(profile);
}
@Get("profileId-admin/{id}")
async getProfileAdmin(@Path() id: string) {
const profile = await this.profileRepository.findOne({
select: ["id", "avatar", "avatarName"],
where: { id },
});
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
return new HttpSuccess(profile);
}
@Get("select/{profileId}/{id}")
public async selectAvatar(@Path() profileId: string, @Path() id: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);