fix error: Request failed with status code 404
This commit is contained in:
parent
a9c26b4377
commit
81b7e14398
2 changed files with 307 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue