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 }[];
|
||||
},
|
||||
) {
|
||||
if (!body.taskList || !body.registeredBranchId)
|
||||
if (body.taskList.length < 1 || !body.registeredBranchId)
|
||||
throw new HttpError(
|
||||
HttpStatus.BAD_REQUEST,
|
||||
"Your created invalid task order",
|
||||
|
|
@ -318,8 +318,8 @@ export class TaskController extends Controller {
|
|||
});
|
||||
|
||||
if (updated.count !== taskList.length) {
|
||||
throw new httperror(
|
||||
httpstatus.precondition_failed,
|
||||
throw new HttpError(
|
||||
HttpStatus.PRECONDITION_FAILED,
|
||||
"all request work to issue task order must be in ready state.",
|
||||
"requestworkmustready",
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue