#849 order.basic-data

This commit is contained in:
Gerard 2018-11-30 11:55:56 +01:00
parent 8aa969c5b4
commit 2ed386d12f
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ const app = require(`${servicesDir}/order/server/server`);
describe('Order updateBasicData', () => {
afterAll(async () => {
let validparams = {note: null};
let orderId = 22;
let orderId = 21;
await app.models.Order.updateBasicData(validparams, orderId);
});
@ -52,7 +52,7 @@ describe('Order updateBasicData', () => {
it('should update the client fiscal data and return the count if changes made', async () => {
let validparams = {note: 'test note'};
let orderId = 22;
let orderId = 21;
let order = await app.models.Order.findById(orderId);

View File

@ -32,7 +32,7 @@ module.exports = Self => {
let order = await Self.app.models.Order.findById(id);
let orderRows = await Self.app.models.OrderRow.find({where: {orderFk: id}});
if (order.confirmed || orderRows.length != 0)
if (order.isConfirmed || orderRows.length != 0)
throw new UserError(`You can't make changes on the basic data of an confirmed order or with rows`);
let validUpdateParams = [