fix error: Request failed with status code 404

This commit is contained in:
Bright 2025-02-04 16:07:51 +07:00
parent a9c26b4377
commit 81b7e14398
2 changed files with 307 additions and 0 deletions

View file

@ -299,6 +299,54 @@ export class DataOptionController extends Controller {
...person,
}
return new HttpSuccess({
person: responsePerson,
assign_no: assign + 1,
assign_month: 6,
})
}
/**
* API (USER)
*
* @summary (USER)
*
*/
@Get("new-assign-user")
async NewAssignUser(@Query() personal_id: string, @Request() request: RequestWithUser) {
const person = await this.personalRepository.findOne({
select: [
"personal_id",
"prefixName",
"firstName",
"lastName",
"posNo",
"positionName",
"positionLevelName",
"positionLineName",
"isProbation",
"orgRootName",
"organization",
"createdAt",
"updatedAt",
],
where: { personal_id },
})
if (!person) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล")
}
const assign = await this.assignRepository.count({
where: {
personal_id,
},
})
const responsePerson = {
id: person.personal_id,
...person,
}
return new HttpSuccess({
person: responsePerson,
assign_no: assign + 1,