เพิ่้มและลบ api history/user

This commit is contained in:
AdisakKanthawilang 2024-05-28 09:30:14 +07:00
parent abc4aee8a4
commit 8d1de6365a
22 changed files with 512 additions and 466 deletions

View file

@ -72,27 +72,6 @@ export class ProfileCertificateEmployeeController extends Controller {
return new HttpSuccess(record);
}
/**
*
* @summary by keycloak
*
*/
@Get("history/user")
public async certificateHistoryUser(@Request() request: RequestWithUser) {
const profile = await this.profileEmployeeRepo.findOneBy({ keycloak: request.user.sub });
if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
const record = await this.certificateHistoryRepo.find({
where: {
histories: {
profileEmployeeId: profile.id,
},
},
});
return new HttpSuccess(record);
}
@Get("history/{certificateId}")
@Example({
status: 200,