diff --git a/src/controllers/07-task-controller.ts b/src/controllers/07-task-controller.ts index cf7b402..02def1e 100644 --- a/src/controllers/07-task-controller.ts +++ b/src/controllers/07-task-controller.ts @@ -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", );