diff --git a/modules/item/front/fixed-price/index.js b/modules/item/front/fixed-price/index.js index 5b807ae0d..b84c2cc2d 100644 --- a/modules/item/front/fixed-price/index.js +++ b/modules/item/front/fixed-price/index.js @@ -48,8 +48,8 @@ export default class Controller extends Section { return; } - const lastId = this.$.model.data.length - 1; - const lastItem = this.$.model.data[lastId]; + const lastIndex = this.$.model.data.length - 1; + const lastItem = this.$.model.data[lastIndex]; this.$.model.insert({ itemFk: lastItem.itemFk, name: lastItem.name, diff --git a/modules/item/front/fixed-price/index.spec.js b/modules/item/front/fixed-price/index.spec.js index 2e09bab77..94621e352 100644 --- a/modules/item/front/fixed-price/index.spec.js +++ b/modules/item/front/fixed-price/index.spec.js @@ -55,8 +55,6 @@ describe('fixed price', () => { jest.spyOn(controller.vnApp, 'showSuccess'); jest.spyOn(controller.$.model, 'remove'); - // $httpBackend.whenRoute('GET', 'Warehouses').respond(); - // $httpBackend.when('GET', 'Warehouses').respond(); $httpBackend.expectGET('Warehouses').respond(); controller.removePrice($index);