Forbid confirmation of order that has not products inside

This commit is contained in:
Tomasz Szymanski 2021-02-03 13:19:26 +01:00
parent 17f9f026bb
commit cfb5bb5168

View file

@ -177,8 +177,9 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
const allowSave = (hasChanged: boolean) => { const allowSave = (hasChanged: boolean) => {
if (order?.status !== OrderStatus.UNCONFIRMED) { if (order?.status !== OrderStatus.UNCONFIRMED) {
return disabled || !hasChanged; return disabled || !hasChanged;
} else if (!order?.lines?.length) {
return true;
} }
return disabled; return disabled;
}; };