fixing throw HttpError
This commit is contained in:
parent
78be6d81b2
commit
0e54b8b880
8 changed files with 90 additions and 90 deletions
|
|
@ -61,7 +61,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!evaluate || !result) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผลการทดลองปฏิบัติราชการ");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผลการทดลองปฏิบัติราชการ");
|
||||
}
|
||||
|
||||
const develop_total_score = await (Number(evaluate.develop_orientation_score) +
|
||||
|
|
@ -205,7 +205,7 @@ export class ReportController extends Controller {
|
|||
const before = personal;
|
||||
|
||||
if (!personal) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคล");
|
||||
}
|
||||
|
||||
personal.order_number = requestBody.command_no;
|
||||
|
|
@ -256,7 +256,7 @@ export class ReportController extends Controller {
|
|||
const before = personal;
|
||||
|
||||
if (!personal) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคล");
|
||||
}
|
||||
|
||||
personal.probation_status = await reqBody.status;
|
||||
|
|
@ -282,7 +282,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!evaluate) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const directorData = await this.assignDirectorRepository.findOne({
|
||||
|
|
@ -291,7 +291,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!directorData) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const director = await {
|
||||
|
|
@ -306,7 +306,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!achievements) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
let achievement: any = [];
|
||||
|
|
@ -516,7 +516,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!assign) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const experimenteeData = await this.personalRepository.findOne({
|
||||
|
|
@ -526,7 +526,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!experimenteeData) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const experimentee = await {
|
||||
|
|
@ -562,7 +562,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!evaluate) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const evaluateData = await {
|
||||
|
|
@ -747,7 +747,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!assign) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const experimenteeData = await this.personalRepository.findOne({
|
||||
|
|
@ -757,7 +757,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!experimenteeData) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const experimentee = await {
|
||||
|
|
@ -786,7 +786,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!commanderData) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const commander = await {
|
||||
|
|
@ -816,7 +816,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!evaluate) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const develop_total_score = await (Number(evaluate.develop_orientation_score) +
|
||||
|
|
@ -1011,7 +1011,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!assign) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const experimenteeData = await this.personalRepository.findOne({
|
||||
|
|
@ -1021,7 +1021,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!experimenteeData) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const experimentee = await {
|
||||
|
|
@ -1041,7 +1041,7 @@ export class ReportController extends Controller {
|
|||
});
|
||||
|
||||
if (!directorData) {
|
||||
return new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const director = await Promise.all(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue