From 16c8d2fd2a2c3d9df481cdeefadebd39a2fe0e5b Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 27 May 2019 08:46:11 +0200 Subject: [PATCH] removed service name from end points --- modules/ticket/front/sale/index.js | 8 ++++---- modules/ticket/front/sale/index.spec.js | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index 0a6ee646c..535241796 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -208,7 +208,7 @@ class Controller { let sales = this.getCheckedLines(); for (let i = 0; i < sales.length; i++) sales[i].quantity = this.sales[sales[i].instance].quantity; - this.$http.post(`claim/api/Claims/createFromSales`, {claim: claim, sales: sales}).then(res => { + this.$http.post(`/api/Claims/createFromSales`, {claim: claim, sales: sales}).then(res => { this.$state.go('claim.card.basicData', {id: res.data.id}); }); } @@ -260,7 +260,7 @@ class Controller { updatePrice() { if (this.editedPrice != this.sale.price) { - this.$http.post(`/ticket/api/Sales/updatePrice`, {id: this.edit.id, price: this.editedPrice, ticketFk: this.ticket.id}).then(() => { + this.$http.post(`/api/Sales/updatePrice`, {id: this.edit.id, price: this.editedPrice, ticketFk: this.ticket.id}).then(() => { this.sale.price = this.edit.price; this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.$scope.model.refresh(); @@ -299,7 +299,7 @@ class Controller { } updateQuantity(id, quantity) { - this.$http.post(`/ticket/api/Sales/${id}/updateQuantity`, {quantity: parseInt(quantity)}).then(() => { + this.$http.post(`/api/Sales/${id}/updateQuantity`, {quantity: parseInt(quantity)}).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); }).catch(e => { this.vnApp.showError(e.data.error.message); @@ -326,7 +326,7 @@ class Controller { let sales = this.getCheckedLines(); let params = {sales: sales, ticketFk: this.ticket.id, reserved: reserved}; - this.$http.post(`/ticket/api/Sales/reserve`, params).then(() => { + this.$http.post(`/api/Sales/reserve`, params).then(() => { this.$scope.model.refresh(); }); } diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js index 23bc4b809..9661c8a09 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/index.spec.js @@ -45,8 +45,8 @@ describe('Ticket', () => { $httpBackend = _$httpBackend_; $httpBackend.whenGET(/api\/Tickets\/1\/getSales.*/).respond(sales); - $httpBackend.whenGET(`/ticket/api/Tickets/1/getVAT`).respond(200, 10.5); - $httpBackend.whenGET(`/ticket/api/Tickets/1/subtotal`).respond(200, 227.5); + $httpBackend.whenGET(`/api/Tickets/1/getVAT`).respond(200, 10.5); + $httpBackend.whenGET(`/api/Tickets/1/subtotal`).respond(200, 227.5); $element = $compile('')($scope); controller = $element.controller('vnTicketSale'); @@ -65,7 +65,7 @@ describe('Ticket', () => { spyOn(controller.$state, 'go'); let res = {id: 1}; - $httpBackend.expectPOST(`claim/api/Claims/createFromSales`).respond(res); + $httpBackend.expectPOST(`/api/Claims/createFromSales`).respond(res); controller.createClaim(); $httpBackend.flush(); @@ -106,7 +106,7 @@ describe('Ticket', () => { let res = [{id: 3}]; spyOn(controller, 'onStateChange'); - $httpBackend.whenGET(`/ticket/api/States?filter=${filter}`).respond(res); + $httpBackend.whenGET(`/api/States?filter=${filter}`).respond(res); controller.onStateOkClick(); $httpBackend.flush(); @@ -116,7 +116,7 @@ describe('Ticket', () => { describe('onStateChange()', () => { it('should perform a post and then call a function', () => { - $httpBackend.expectPOST(`/ticket/api/TicketTrackings/changeState`).respond(); + $httpBackend.expectPOST(`/api/TicketTrackings/changeState`).respond(); controller.onStateChange(3); $httpBackend.flush(); }); @@ -126,7 +126,7 @@ describe('Ticket', () => { it('should call getCheckedLines, call removeInstances, and make a query', () => { controller.sales[1].checked = true; - $httpBackend.whenPOST(`/ticket/api/Sales/removes`).respond(); + $httpBackend.whenPOST(`/api/Sales/removes`).respond(); controller.onRemoveLinesClick('ACCEPT'); $httpBackend.flush(); @@ -166,7 +166,7 @@ describe('Ticket', () => { reserved: false }; - $httpBackend.expectPOST(`/ticket/api/Sales/reserve`, expectedRequest).respond(); + $httpBackend.expectPOST(`/api/Sales/reserve`, expectedRequest).respond(); controller.unmarkAsReserved(false); $httpBackend.flush(); });