fix noti ติด promise

This commit is contained in:
Bright 2024-10-15 17:20:25 +07:00
parent bce74cca54
commit ad97270752

View file

@ -1013,9 +1013,11 @@ export class CommandController extends Controller {
if (command.commandExcecuteDate == null)
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบวันที่คำสั่งมีผล");
let profiles = command.commandRecives
.filter((x) => x.profileId != null)
.map(async (x) => x.profileId);
let profiles = command && command.commandRecives.length > 0
? command.commandRecives
.filter((x) => x.profileId != null)
.map((x) => x.profileId)
: [];
await new CallAPI()
.PostData(request, "/placement/noti/profiles", {