fix update order via strapi ui
This commit is contained in:
parent
2074955d19
commit
c5d4a2f782
@ -64,6 +64,19 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const existingOrder = await strapi.db.query('api::order.order').findOne({
|
||||
where: { id: entityId },
|
||||
select: ['documentId'],
|
||||
populate: ['slot'],
|
||||
});
|
||||
|
||||
if (
|
||||
existingOrder.time_start === time_start &&
|
||||
existingOrder.time_end === time_end
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!time_start || !time_end) {
|
||||
throw new Error(ERR_INVALID_TIME);
|
||||
}
|
||||
@ -72,12 +85,6 @@ export default {
|
||||
throw new Error(ERR_INVALID_TIME);
|
||||
}
|
||||
|
||||
const existingOrder = await strapi.db.query('api::order.order').findOne({
|
||||
where: { id: entityId },
|
||||
select: ['documentId'],
|
||||
populate: ['slot'],
|
||||
});
|
||||
|
||||
if (!existingOrder || !existingOrder.slot) {
|
||||
throw new Error('Существующий заказ или слот не найден');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user