refactor: handle code error
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
This commit is contained in:
parent
78669ed7ae
commit
16c4c64c89
1 changed files with 3 additions and 3 deletions
|
|
@ -265,7 +265,7 @@ export class TaskController extends Controller {
|
||||||
taskProduct?: { productId: string; discount?: number }[];
|
taskProduct?: { productId: string; discount?: number }[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
if (!body.taskList || !body.registeredBranchId)
|
if (body.taskList.length < 1 || !body.registeredBranchId)
|
||||||
throw new HttpError(
|
throw new HttpError(
|
||||||
HttpStatus.BAD_REQUEST,
|
HttpStatus.BAD_REQUEST,
|
||||||
"Your created invalid task order",
|
"Your created invalid task order",
|
||||||
|
|
@ -318,8 +318,8 @@ export class TaskController extends Controller {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (updated.count !== taskList.length) {
|
if (updated.count !== taskList.length) {
|
||||||
throw new httperror(
|
throw new HttpError(
|
||||||
httpstatus.precondition_failed,
|
HttpStatus.PRECONDITION_FAILED,
|
||||||
"all request work to issue task order must be in ready state.",
|
"all request work to issue task order must be in ready state.",
|
||||||
"requestworkmustready",
|
"requestworkmustready",
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue