diff --git a/front/core/lib/module-loader.js b/front/core/lib/module-loader.js index 477b1c943..d42583b5a 100644 --- a/front/core/lib/module-loader.js +++ b/front/core/lib/module-loader.js @@ -42,7 +42,7 @@ export function factory($http, $window, $ocLazyLoad, $translatePartialLoader, $t if (validations) { promises.push(new Promise(resolve => { - $http.get(`/${moduleName}/api/modelInfo`).then( + $http.get(`api/modelInfo`).then( json => this.onValidationsReady(json, resolve), () => resolve() ); diff --git a/modules/agency/front/basic-data/index.html b/modules/agency/front/basic-data/index.html index 7f4ed91ef..a14bbaf5c 100644 --- a/modules/agency/front/basic-data/index.html +++ b/modules/agency/front/basic-data/index.html @@ -1,4 +1,4 @@ - + { if (res.data) this.zone = res.data; diff --git a/modules/agency/front/card/index.spec.js b/modules/agency/front/card/index.spec.js index 86d3ebaa4..0839d7f53 100644 --- a/modules/agency/front/card/index.spec.js +++ b/modules/agency/front/card/index.spec.js @@ -26,7 +26,7 @@ describe('Agency Component vnZoneCard', () => { ] }; let json = encodeURIComponent(JSON.stringify(filter)); - $httpBackend.expectGET(`/agency/api/Zones/1?filter=${json}`).respond({id: 1}); + $httpBackend.expectGET(`api/Zones/1?filter=${json}`).respond({id: 1}); controller.getCard(); $httpBackend.flush(); diff --git a/modules/agency/front/create/index.html b/modules/agency/front/create/index.html index 461829259..e287c8e7d 100644 --- a/modules/agency/front/create/index.html +++ b/modules/agency/front/create/index.html @@ -1,4 +1,4 @@ - + diff --git a/modules/agency/front/descriptor/index.js b/modules/agency/front/descriptor/index.js index c8d6bbc26..b599dfd40 100644 --- a/modules/agency/front/descriptor/index.js +++ b/modules/agency/front/descriptor/index.js @@ -20,7 +20,7 @@ class Controller { returnDialog(response) { if (response === 'ACCEPT') { - this.$http.delete(`/agency/api/Zones/${this.zone.id}`).then(() => { + this.$http.delete(`api/Zones/${this.zone.id}`).then(() => { this.$state.go('zone.index'); }); } diff --git a/modules/agency/front/edit/index.html b/modules/agency/front/edit/index.html index 452c54417..8143c5643 100644 --- a/modules/agency/front/edit/index.html +++ b/modules/agency/front/edit/index.html @@ -1,4 +1,4 @@ - + @@ -25,7 +25,7 @@ diff --git a/modules/agency/front/index/index.js b/modules/agency/front/index/index.js index a85be6e72..a95f5c949 100644 --- a/modules/agency/front/index/index.js +++ b/modules/agency/front/index/index.js @@ -42,7 +42,7 @@ export default class Controller { */ onCloneAccept(response) { if (!(response == 'ACCEPT' && this.selectedZone)) return; - const query = `/agency/api/Zones/${this.selectedZone.id}/clone`; + const query = `api/Zones/${this.selectedZone.id}/clone`; this.$http.post(query).then(res => { if (res && res.data) this.$state.go('zone.card.basicData', {id: res.data.id}); diff --git a/modules/agency/front/location-search-panel/index.html b/modules/agency/front/location-search-panel/index.html index 9621f8b56..39f2b2938 100644 --- a/modules/agency/front/location-search-panel/index.html +++ b/modules/agency/front/location-search-panel/index.html @@ -20,7 +20,7 @@ vn-one label="Agency" field="filter.agencyModeFk" - url="/agency/api/AgencyModes/isActive" + url="api/AgencyModes/isActive" show-field="name" value-field="id"> @@ -28,7 +28,7 @@ vn-one label="Warehouse" field="filter.warehouseFk" - url="/agency/api/Warehouses" + url="api/Warehouses" show-field="name" value-field="id"> diff --git a/modules/agency/front/location/calendar.html b/modules/agency/front/location/calendar.html index ad58aee1a..39b54133e 100644 --- a/modules/agency/front/location/calendar.html +++ b/modules/agency/front/location/calendar.html @@ -1,6 +1,6 @@ { if (!res.data) return; const events = []; @@ -128,7 +128,7 @@ class Controller { if (dates.length == 0) return; const params = {zoneFk: this.zone.id, dates}; - this.$http.post('/agency/api/zoneCalendars/removeByDate', params).then(() => { + this.$http.post('api/zoneCalendars/removeByDate', params).then(() => { this.events = calendar.events; }); } diff --git a/modules/agency/front/location/index.js b/modules/agency/front/location/index.js index 3e3decf23..da47fa299 100644 --- a/modules/agency/front/location/index.js +++ b/modules/agency/front/location/index.js @@ -24,7 +24,7 @@ class Controller { node.isIncluded = isIncluded; node.childs = []; // Data too large - const path = '/agency/api/ZoneIncludeds/toggleIsIncluded'; + const path = 'api/ZoneIncludeds/toggleIsIncluded'; const params = {zoneFk: this.zone.id, item: node}; this.$http.post(path, params); } diff --git a/modules/agency/front/search-panel/index.html b/modules/agency/front/search-panel/index.html index fd0a0158b..2ad89291d 100644 --- a/modules/agency/front/search-panel/index.html +++ b/modules/agency/front/search-panel/index.html @@ -21,7 +21,7 @@ vn-one label="Agency" field="filter.agencyModeFk" - url="/agency/api/AgencyModes/isActive" + url="api/AgencyModes/isActive" show-field="name" value-field="id"> @@ -29,7 +29,7 @@ vn-one label="Warehouse" field="filter.warehouseFk" - url="/agency/api/Warehouses" + url="api/Warehouses" show-field="name" value-field="id"> diff --git a/modules/agency/front/summary/index.js b/modules/agency/front/summary/index.js index 1c200edde..641d70b78 100644 --- a/modules/agency/front/summary/index.js +++ b/modules/agency/front/summary/index.js @@ -26,7 +26,7 @@ class Controller { where: {id: this.zone.id} }; filter = encodeURIComponent(JSON.stringify((filter))); - this.$http.get(`/agency/api/Zones/findOne?filter=${filter}`).then(res => { + this.$http.get(`api/Zones/findOne?filter=${filter}`).then(res => { if (res && res.data) this.summary = res.data; }); diff --git a/modules/claim/front/action/index.html b/modules/claim/front/action/index.html index 3875b9912..1867d330f 100644 --- a/modules/claim/front/action/index.html +++ b/modules/claim/front/action/index.html @@ -1,6 +1,6 @@ @@ -87,7 +87,7 @@ vn-one id="claimDestinationFk" field="saleClaimed.claimDestinationFk" - url="/claim/api/ClaimDestinations" + url="api/ClaimDestinations" fields="['id','description']" value-field="id" show-field="description" @@ -166,7 +166,7 @@ diff --git a/modules/claim/front/action/index.js b/modules/claim/front/action/index.js index 5193b5114..c09fd0e8b 100644 --- a/modules/claim/front/action/index.js +++ b/modules/claim/front/action/index.js @@ -34,7 +34,7 @@ class Controller { getClaimedSales() { let json = encodeURIComponent(JSON.stringify(this.claim.id)); - let query = `/claim/api/ClaimBeginnings/${json}`; + let query = `api/ClaimBeginnings/${json}`; this.$http.get(query).then(res => { if (res.data) this.claimedSales = res.data; @@ -43,7 +43,7 @@ class Controller { addClaimedSale(saleFk) { let saleToAdd = {saleFk: saleFk, claimFk: this.claim.id, workerFk: this.claim.workerFk, claimDestinationFk: 1}; - let query = `claim/api/ClaimEnds/`; + let query = `api/ClaimEnds/`; this.$http.post(query, saleToAdd).then(() => { this.$.model.refresh(); this.$.addSales.hide(); @@ -53,7 +53,7 @@ class Controller { deleteClaimedSale(id) { let json = encodeURIComponent(JSON.stringify(id)); - let query = `claim/api/ClaimEnds/${json}`; + let query = `api/ClaimEnds/${json}`; this.$http.delete(query).then(() => { this.$.model.refresh(); this.vnApp.showSuccess(this.$translate.instant('Data saved!')); @@ -61,7 +61,7 @@ class Controller { } importToNewRefundTicket() { - let query = `claim/api/ClaimBeginnings/${this.$stateParams.id}/importToNewRefundTicket`; + let query = `api/ClaimBeginnings/${this.$stateParams.id}/importToNewRefundTicket`; return this.$http.post(query).then(() => { this.$.model.refresh(); this.vnApp.showSuccess(this.$translate.instant('Data saved!')); @@ -85,7 +85,7 @@ class Controller { setClaimDestination(id, claimDestinationFk) { if (claimDestinationFk) { let params = {id: id, claimDestinationFk: claimDestinationFk}; - let query = `claim/api/ClaimEnds/`; + let query = `api/ClaimEnds/`; this.$http.patch(query, params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); }); @@ -122,7 +122,7 @@ class Controller { importTicketLines(ticketFk) { let data = {claimFk: this.$stateParams.id, ticketFk: ticketFk}; - let query = `/claim/api/ClaimEnds/importTicketSales`; + let query = `api/ClaimEnds/importTicketSales`; this.$http.post(query, data).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.$.lastTicketsPopover.hide(); @@ -132,7 +132,7 @@ class Controller { regularize() { let data = {claimFk: this.$stateParams.id}; - let query = `/claim/api/Claims/regularizeClaim`; + let query = `api/Claims/regularizeClaim`; return this.$http.post(query, data).then(() => { this.card.reload(); this.vnApp.showSuccess(this.$translate.instant('Data saved!')); @@ -145,7 +145,7 @@ class Controller { if (response !== 'ACCEPT') return; let greugeTypeFreight = 7; - let query = `claim/api/Greuges/`; + let query = `api/Greuges/`; let data = { clientFk: this.claim.clientFk, description: `claim: ${this.claim.id}`, diff --git a/modules/claim/front/action/index.spec.js b/modules/claim/front/action/index.spec.js index d1f8f9766..59203aabe 100644 --- a/modules/claim/front/action/index.spec.js +++ b/modules/claim/front/action/index.spec.js @@ -46,7 +46,7 @@ describe('claim', () => { describe('getClaimedSales()', () => { it('should make a query and set salesToClaim', () => { controller.claim.id = 1; - $httpBackend.expectGET(`/claim/api/ClaimBeginnings/1`).respond(200, 1); + $httpBackend.expectGET(`api/ClaimBeginnings/1`).respond(200, 1); controller.getClaimedSales(); $httpBackend.flush(); @@ -59,7 +59,7 @@ describe('claim', () => { spyOn(controller.$.model, 'refresh'); spyOn(controller.$.addSales, 'hide'); spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.expectPOST(`claim/api/ClaimEnds/`).respond({}); + $httpBackend.expectPOST(`api/ClaimEnds/`).respond({}); controller.addClaimedSale(1); $httpBackend.flush(); @@ -73,7 +73,7 @@ describe('claim', () => { it('should make a delete and call refresh and showSuccess', () => { spyOn(controller.$.model, 'refresh'); spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.expectDELETE(`claim/api/ClaimEnds/1`).respond({}); + $httpBackend.expectDELETE(`api/ClaimEnds/1`).respond({}); controller.deleteClaimedSale(1); $httpBackend.flush(); @@ -85,7 +85,7 @@ describe('claim', () => { describe('setClaimDestination(id, claimDestinationFk)', () => { it('should make a patch and call refresh and showSuccess', () => { spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.expectPATCH(`claim/api/ClaimEnds/`).respond({}); + $httpBackend.expectPATCH(`api/ClaimEnds/`).respond({}); controller.setClaimDestination(1, 1); $httpBackend.flush(); @@ -110,7 +110,7 @@ describe('claim', () => { it('should perform a post query and add lines from a new ticket', () => { spyOn(controller.$.model, 'refresh'); spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.expect('POST', `claim/api/ClaimBeginnings/1/importToNewRefundTicket`).respond({}); + $httpBackend.expect('POST', `api/ClaimBeginnings/1/importToNewRefundTicket`).respond({}); controller.importToNewRefundTicket(); $httpBackend.flush(); @@ -136,7 +136,7 @@ describe('claim', () => { spyOn(controller.vnApp, 'showSuccess'); spyOn(controller.$.lastTicketsPopover, 'hide'); let data = {claimFk: 1, ticketFk: 1}; - $httpBackend.expect('POST', `/claim/api/ClaimEnds/importTicketSales`, data).respond({}); + $httpBackend.expect('POST', `api/ClaimEnds/importTicketSales`, data).respond({}); controller.importTicketLines(1); $httpBackend.flush(); @@ -152,7 +152,7 @@ describe('claim', () => { spyOn(controller.vnApp, 'showSuccess'); let data = {claimFk: $state.params.id}; - $httpBackend.expect('POST', `/claim/api/Claims/regularizeClaim`, data).respond({}); + $httpBackend.expect('POST', `api/Claims/regularizeClaim`, data).respond({}); controller.regularize(); $httpBackend.flush(); @@ -186,7 +186,7 @@ describe('claim', () => { greugeTypeFk: 7, ticketFk: controller.claim.ticketFk }; - $httpBackend.expect('POST', `claim/api/Greuges/`, data).respond(); + $httpBackend.expect('POST', `api/Greuges/`, data).respond(); controller.onUpdateGreugeResponse('ACCEPT'); $httpBackend.flush(); diff --git a/modules/claim/front/basic-data/index.html b/modules/claim/front/basic-data/index.html index b626f57c7..87d04c603 100644 --- a/modules/claim/front/basic-data/index.html +++ b/modules/claim/front/basic-data/index.html @@ -12,7 +12,7 @@ vn-one disabled="true" field="$ctrl.claim.clientFk" - url="/client/api/Clients" + url="api/Clients" show-field="name" value-field="id" label="Client" @@ -41,7 +41,7 @@ { if (res.data) this.claim = res.data; diff --git a/modules/claim/front/card/index.spec.js b/modules/claim/front/card/index.spec.js index 3ac4c7e32..17d4e3174 100644 --- a/modules/claim/front/card/index.spec.js +++ b/modules/claim/front/card/index.spec.js @@ -21,7 +21,7 @@ describe('Claim', () => { describe('getCard()', () => { it(`should make a query and save the data in claim`, () => { let json = encodeURIComponent(JSON.stringify(controller.filter)); - $httpBackend.expectGET(`/claim/api/Claims/${controller.$state.params.id}?filter=${json}`).respond({id: 1}); + $httpBackend.expectGET(`api/Claims/${controller.$state.params.id}?filter=${json}`).respond({id: 1}); controller.getCard(); $httpBackend.flush(); diff --git a/modules/claim/front/descriptor/index.js b/modules/claim/front/descriptor/index.js index 8d6977ea6..fa39c3638 100644 --- a/modules/claim/front/descriptor/index.js +++ b/modules/claim/front/descriptor/index.js @@ -82,7 +82,7 @@ class Controller { deleteClaim(response) { if (response === 'ACCEPT') { - this.$http.delete(`/claim/api/Claims/${this.claim.id}`).then(() => { + this.$http.delete(`api/Claims/${this.claim.id}`).then(() => { this.vnApp.showSuccess(this.$translate.instant('Claim deleted!')); this.$state.go('claim.index'); }); diff --git a/modules/claim/front/descriptor/index.spec.js b/modules/claim/front/descriptor/index.spec.js index c6446a15b..6c10564b4 100644 --- a/modules/claim/front/descriptor/index.spec.js +++ b/modules/claim/front/descriptor/index.spec.js @@ -68,8 +68,8 @@ describe('Item Component vnClaimDescriptor', () => { spyOn(controller.vnApp, 'showSuccess'); spyOn(controller.$state, 'go'); - $httpBackend.when('DELETE', `/claim/api/Claims/2`).respond(200); - $httpBackend.expect('DELETE', `/claim/api/Claims/2`); + $httpBackend.when('DELETE', `api/Claims/2`).respond(200); + $httpBackend.expect('DELETE', `api/Claims/2`); controller.deleteClaim(response); $httpBackend.flush(); diff --git a/modules/claim/front/detail/index.html b/modules/claim/front/detail/index.html index 5fc032e33..6ade7a80f 100644 --- a/modules/claim/front/detail/index.html +++ b/modules/claim/front/detail/index.html @@ -1,7 +1,7 @@ diff --git a/modules/claim/front/detail/index.js b/modules/claim/front/detail/index.js index 137ad4d70..94d5cf76f 100644 --- a/modules/claim/front/detail/index.js +++ b/modules/claim/front/detail/index.js @@ -63,7 +63,7 @@ class Controller { addClaimedSale(index) { let sale = this.salesToClaim[index]; let saleToAdd = {saleFk: sale.saleFk, claimFk: this.claim.id, quantity: sale.quantity}; - let query = `claim/api/ClaimBeginnings/`; + let query = `api/ClaimBeginnings/`; this.$http.post(query, saleToAdd).then(() => { this.$.addSales.hide(); this.$.model.refresh(); @@ -76,7 +76,7 @@ class Controller { deleteClaimedSale(index) { let sale = this.salesClaimed[index]; - let query = `claim/api/ClaimBeginnings/${sale.id}`; + let query = `api/ClaimBeginnings/${sale.id}`; this.$http.delete(query).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.$.model.remove(index); @@ -86,7 +86,7 @@ class Controller { setClaimedQuantity(id, claimedQuantity) { let params = {id: id, quantity: claimedQuantity}; - let query = `claim/api/ClaimBeginnings/`; + let query = `api/ClaimBeginnings/`; this.$http.patch(query, params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.calculateTotals(); diff --git a/modules/claim/front/detail/index.spec.js b/modules/claim/front/detail/index.spec.js index c25d6fe43..3550468fe 100644 --- a/modules/claim/front/detail/index.spec.js +++ b/modules/claim/front/detail/index.spec.js @@ -14,7 +14,7 @@ describe('claim', () => { beforeEach(angular.mock.inject(($componentController, _$state_, _$httpBackend_) => { $httpBackend = _$httpBackend_; - $httpBackend.when('GET', 'claim/api/Claims/ClaimBeginnings').respond({}); + $httpBackend.when('GET', 'api/Claims/ClaimBeginnings').respond({}); $state = _$state_; aclService = {hasAny: () => true}; controller = $componentController('vnClaimDetail', {$state, aclService}); @@ -54,7 +54,7 @@ describe('claim', () => { it('should make a post and call refresh, hide and showSuccess', () => { spyOn(controller.$.addSales, 'hide'); spyOn(controller.$state, 'go'); - $httpBackend.expectPOST(`claim/api/ClaimBeginnings/`).respond({}); + $httpBackend.expectPOST(`api/ClaimBeginnings/`).respond({}); controller.addClaimedSale(1); $httpBackend.flush(); @@ -66,7 +66,7 @@ describe('claim', () => { describe('deleteClaimedSale(index)', () => { it('should make a delete and call refresh and showSuccess', () => { spyOn(controller.$.model, 'remove'); - $httpBackend.expectDELETE(`claim/api/ClaimBeginnings/1`).respond({}); + $httpBackend.expectDELETE(`api/ClaimBeginnings/1`).respond({}); controller.deleteClaimedSale(0); $httpBackend.flush(); @@ -77,7 +77,7 @@ describe('claim', () => { describe('setClaimedQuantity(id, claimedQuantity)', () => { it('should make a patch and call refresh and showSuccess', () => { spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.expectPATCH(`claim/api/ClaimBeginnings/`).respond({}); + $httpBackend.expectPATCH(`api/ClaimBeginnings/`).respond({}); controller.setClaimedQuantity(1, 1); $httpBackend.flush(); diff --git a/modules/claim/front/development/index.html b/modules/claim/front/development/index.html index e3f368451..a5035ec9f 100644 --- a/modules/claim/front/development/index.html +++ b/modules/claim/front/development/index.html @@ -1,6 +1,6 @@ diff --git a/modules/claim/front/index/index.html b/modules/claim/front/index/index.html index caeb756de..02c768245 100644 --- a/modules/claim/front/index/index.html +++ b/modules/claim/front/index/index.html @@ -1,6 +1,6 @@ diff --git a/modules/claim/front/search-panel/index.html b/modules/claim/front/search-panel/index.html index 5540c87c8..a62434c32 100644 --- a/modules/claim/front/search-panel/index.html +++ b/modules/claim/front/search-panel/index.html @@ -32,7 +32,7 @@ {{description}} diff --git a/modules/claim/front/summary/index.js b/modules/claim/front/summary/index.js index 5741f2c06..509d9fd4b 100644 --- a/modules/claim/front/summary/index.js +++ b/modules/claim/front/summary/index.js @@ -7,7 +7,7 @@ class Controller { } getSummary() { - this.$http.get(`/claim/api/Claims/${this.claim.id}/getSummary`).then(response => { + this.$http.get(`api/Claims/${this.claim.id}/getSummary`).then(response => { this.summary = response.data; }); } diff --git a/modules/claim/front/summary/index.spec.js b/modules/claim/front/summary/index.spec.js index c56b91251..b9583e81c 100644 --- a/modules/claim/front/summary/index.spec.js +++ b/modules/claim/front/summary/index.spec.js @@ -17,8 +17,8 @@ describe('Claim', () => { describe('getSummary()', () => { it('should perform a query to set summary', () => { - $httpBackend.when('GET', `/claim/api/Claims/1/getSummary`).respond(200, 24); - $httpBackend.expect('GET', `/claim/api/Claims/1/getSummary`); + $httpBackend.when('GET', `api/Claims/1/getSummary`).respond(200, 24); + $httpBackend.expect('GET', `api/Claims/1/getSummary`); controller.getSummary(); $httpBackend.flush(); diff --git a/modules/client/front/address/create/index.html b/modules/client/front/address/create/index.html index 0240aceb5..fc89c14a4 100644 --- a/modules/client/front/address/create/index.html +++ b/modules/client/front/address/create/index.html @@ -1,6 +1,6 @@ @@ -85,7 +85,7 @@ diff --git a/modules/client/front/address/index/index.js b/modules/client/front/address/index/index.js index 96859a0c0..8e1409abe 100644 --- a/modules/client/front/address/index/index.js +++ b/modules/client/front/address/index/index.js @@ -45,7 +45,7 @@ class Controller { } setDefault(address) { - let query = `/client/api/Clients/${this.$stateParams.id}`; + let query = `api/Clients/${this.$stateParams.id}`; let params = {defaultAddressFk: address.id}; this.$http.patch(query, params).then(res => { if (res.data) { diff --git a/modules/client/front/address/index/index.spec.js b/modules/client/front/address/index/index.spec.js index 5cb951745..16d58b910 100644 --- a/modules/client/front/address/index/index.spec.js +++ b/modules/client/front/address/index/index.spec.js @@ -29,8 +29,8 @@ describe('Client', () => { let data = {defaultAddressFk: address.id}; let expectedResult = {defaultAddressFk: address.id}; - $httpBackend.when('PATCH', `/client/api/Clients/1`, data).respond(200, expectedResult); - $httpBackend.expect('PATCH', `/client/api/Clients/1`, data); + $httpBackend.when('PATCH', `api/Clients/1`, data).respond(200, expectedResult); + $httpBackend.expect('PATCH', `api/Clients/1`, data); controller.setDefault(address); $httpBackend.flush(); diff --git a/modules/client/front/balance/create/index.html b/modules/client/front/balance/create/index.html index 4cf769d4f..1fc44c577 100644 --- a/modules/client/front/balance/create/index.html +++ b/modules/client/front/balance/create/index.html @@ -2,7 +2,7 @@ vn-id="dialog" class="modal-form"> - + New payment diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js index 6d028e885..ea3ab3391 100644 --- a/modules/client/front/balance/create/index.js +++ b/modules/client/front/balance/create/index.js @@ -62,7 +62,7 @@ class Controller { } }; - let query = `/client/api/ClientRisks?filter=${JSON.stringify(filter)}`; + let query = `api/ClientRisks?filter=${JSON.stringify(filter)}`; this.$http.get(query).then(res => { this.receipt.amountPaid = (res.data.length && res.data[0].amount) || null; }); @@ -77,7 +77,7 @@ class Controller { } save() { - let query = `/client/api/receipts`; + let query = `api/receipts`; this.$http.post(query, this.receipt).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.hide(); diff --git a/modules/client/front/balance/index/index.html b/modules/client/front/balance/index/index.html index 045eb1f80..d98c14eb1 100644 --- a/modules/client/front/balance/index/index.html +++ b/modules/client/front/balance/index/index.html @@ -1,13 +1,13 @@ @@ -20,7 +20,7 @@ vn-id="company" field="$ctrl.companyFk" on-change="$ctrl.setOrder(value)" - url="/client/api/Companies" + url="api/Companies" show-field="code" value-field="id" label="Select company"> diff --git a/modules/client/front/balance/index/index.js b/modules/client/front/balance/index/index.js index 5611e9460..7de0dd2ef 100644 --- a/modules/client/front/balance/index/index.js +++ b/modules/client/front/balance/index/index.js @@ -45,7 +45,7 @@ class Controller { if (!value) return; const params = {filter: this.filter}; - this.$http.get(`/client/api/ClientRisks`, {params}).then(response => { + this.$http.get(`api/ClientRisks`, {params}).then(response => { if (response.data) { this.clientRisks = response.data; diff --git a/modules/client/front/balance/index/index.spec.js b/modules/client/front/balance/index/index.spec.js index 11a9766b4..7d5568107 100644 --- a/modules/client/front/balance/index/index.spec.js +++ b/modules/client/front/balance/index/index.spec.js @@ -31,8 +31,8 @@ describe('Client', () => { ]; const params = {filter: controller.filter}; let serializedParams = $httpParamSerializer(params); - $httpBackend.when('GET', `/client/api/ClientRisks?${serializedParams}`).respond(balances); - $httpBackend.expect('GET', `/client/api/ClientRisks?${serializedParams}`); + $httpBackend.when('GET', `api/ClientRisks?${serializedParams}`).respond(balances); + $httpBackend.expect('GET', `api/ClientRisks?${serializedParams}`); controller.balances = balances; $httpBackend.flush(); diff --git a/modules/client/front/basic-data/index.html b/modules/client/front/basic-data/index.html index f994d1905..d168e8b1f 100644 --- a/modules/client/front/basic-data/index.html +++ b/modules/client/front/basic-data/index.html @@ -1,4 +1,4 @@ - + diff --git a/modules/client/front/billing-data/index.html b/modules/client/front/billing-data/index.html index d923123b7..9497ba6a7 100644 --- a/modules/client/front/billing-data/index.html +++ b/modules/client/front/billing-data/index.html @@ -1,4 +1,4 @@ - + @@ -33,7 +33,7 @@ diff --git a/modules/client/front/billing-data/index.js b/modules/client/front/billing-data/index.js index edd6db654..13dc23eeb 100644 --- a/modules/client/front/billing-data/index.js +++ b/modules/client/front/billing-data/index.js @@ -62,7 +62,7 @@ export default class Controller { if (!this.newBankEntity.bic) throw new Error(`Swift / BIC can't be empty`); - this.$http.post(`/client/api/BankEntities`, this.newBankEntity).then(response => { + this.$http.post(`api/BankEntities`, this.newBankEntity).then(response => { if (response.data) this.client.bankEntityFk = response.data.id; }); @@ -91,7 +91,7 @@ export default class Controller { if (this.ibanCountry != 'ES') return; let json = encodeURIComponent(JSON.stringify(filter)); - this.$http.get(`/client/api/BankEntities?filter=${json}`).then(response => { + this.$http.get(`api/BankEntities?filter=${json}`).then(response => { const hasData = response.data && response.data[0]; if (hasData) diff --git a/modules/client/front/billing-data/index.spec.js b/modules/client/front/billing-data/index.spec.js index 4a53f9a06..689ddc882 100644 --- a/modules/client/front/billing-data/index.spec.js +++ b/modules/client/front/billing-data/index.spec.js @@ -80,8 +80,8 @@ describe('Client', () => { id: 999 }; controller.newBankEntity = newBankEntity; - $httpBackend.when('POST', '/client/api/BankEntities').respond('done'); - $httpBackend.expectPOST('/client/api/BankEntities', newBankEntity); + $httpBackend.when('POST', 'api/BankEntities').respond('done'); + $httpBackend.expectPOST('api/BankEntities', newBankEntity); controller.onBankEntityResponse('ACCEPT'); $httpBackend.flush(); }); @@ -94,8 +94,8 @@ describe('Client', () => { let expectedFilter = {where: {id: 2100}}; let json = encodeURIComponent(JSON.stringify(expectedFilter)); - $httpBackend.when('GET', `/client/api/BankEntities?filter=${json}`).respond('done'); - $httpBackend.expect('GET', `/client/api/BankEntities?filter=${json}`); + $httpBackend.when('GET', `api/BankEntities?filter=${json}`).respond('done'); + $httpBackend.expect('GET', `api/BankEntities?filter=${json}`); controller.autofillBic(); $httpBackend.flush(); @@ -108,8 +108,8 @@ describe('Client', () => { let expectedFilter = {where: {id: 128}}; let json = encodeURIComponent(JSON.stringify(expectedFilter)); - $httpBackend.when('GET', `/client/api/BankEntities?filter=${json}`).respond([{id: 128}]); - $httpBackend.expect('GET', `/client/api/BankEntities?filter=${json}`); + $httpBackend.when('GET', `api/BankEntities?filter=${json}`).respond([{id: 128}]); + $httpBackend.expect('GET', `api/BankEntities?filter=${json}`); controller.autofillBic(); $httpBackend.flush(); diff --git a/modules/client/front/card/index.js b/modules/client/front/card/index.js index a17a01883..33f51364c 100644 --- a/modules/client/front/card/index.js +++ b/modules/client/front/card/index.js @@ -13,7 +13,7 @@ export default class Controller { } getCard() { - this.$http.get(`/client/api/Clients/${this.$stateParams.id}/getCard`).then(response => { + this.$http.get(`api/Clients/${this.$stateParams.id}/getCard`).then(response => { this.client = response.data; }); } diff --git a/modules/client/front/contact/index.html b/modules/client/front/contact/index.html index b66eb782e..6ae1c0c03 100644 --- a/modules/client/front/contact/index.html +++ b/modules/client/front/contact/index.html @@ -1,6 +1,6 @@ + { clientFk: 101 }; - $httpBackend.whenPOST(`/client/api/creditClassifications/createWithInsurance`, newData).respond(200, true); - $httpBackend.expectPOST(`/client/api/creditClassifications/createWithInsurance`, newData); + $httpBackend.whenPOST(`api/creditClassifications/createWithInsurance`, newData).respond(200, true); + $httpBackend.expectPOST(`api/creditClassifications/createWithInsurance`, newData); controller.onSubmit(); $httpBackend.flush(); }); diff --git a/modules/client/front/credit-insurance/index/index.js b/modules/client/front/credit-insurance/index/index.js index 6d6994a9a..4d108428e 100644 --- a/modules/client/front/credit-insurance/index/index.js +++ b/modules/client/front/credit-insurance/index/index.js @@ -30,7 +30,7 @@ class Controller { }; filter = encodeURIComponent(JSON.stringify(filter)); - let query = `/client/api/CreditClassifications?filter=${filter}`; + let query = `api/CreditClassifications?filter=${filter}`; this.$http.get(query).then(res => { if (res.data) this.classifications = res.data; @@ -58,7 +58,7 @@ class Controller { returnDialog(response) { if (response === 'ACCEPT') { let params = {finished: Date.now()}; - this.$http.patch(`/client/api/CreditClassifications/${this.classificationId}`, params).then(() => { + this.$http.patch(`api/CreditClassifications/${this.classificationId}`, params).then(() => { this._getClassifications(this.client.id); }); } diff --git a/modules/client/front/credit-insurance/index/index.spec.js b/modules/client/front/credit-insurance/index/index.spec.js index 5bf33faca..9be3f0641 100644 --- a/modules/client/front/credit-insurance/index/index.spec.js +++ b/modules/client/front/credit-insurance/index/index.spec.js @@ -18,7 +18,7 @@ describe('Client', () => { describe('_getClassifications()', () => { it('should perform a GET query to define the classifications property in the controller', () => { let res = ['some classifications']; - let query = '/client/api/CreditClassifications?filter=%7B%22order%22%3A%22finished%20ASC%2C%20started%20DESC%22%2C%22include%22%3A%5B%7B%22relation%22%3A%22insurances%22%2C%22scope%22%3A%7B%22fields%22%3A%5B%22id%22%2C%22credit%22%2C%22created%22%2C%22grade%22%5D%2C%22order%22%3A%22created%20DESC%22%2C%22limit%22%3A2%7D%7D%5D%2C%22where%22%3A%7B%7D%7D'; + let query = 'api/CreditClassifications?filter=%7B%22order%22%3A%22finished%20ASC%2C%20started%20DESC%22%2C%22include%22%3A%5B%7B%22relation%22%3A%22insurances%22%2C%22scope%22%3A%7B%22fields%22%3A%5B%22id%22%2C%22credit%22%2C%22created%22%2C%22grade%22%5D%2C%22order%22%3A%22created%20DESC%22%2C%22limit%22%3A2%7D%7D%5D%2C%22where%22%3A%7B%7D%7D'; $httpBackend.whenGET(query).respond(res); $httpBackend.expectGET(query); @@ -76,8 +76,8 @@ describe('Client', () => { it('should call the returnDialog method and perform a PATCH query, then call _getClassifications method', () => { spyOn(controller, '_getClassifications'); controller.classificationId = 1; - $httpBackend.when('PATCH', `/client/api/CreditClassifications/1`).respond(200); - $httpBackend.expect('PATCH', `/client/api/CreditClassifications/1`); + $httpBackend.when('PATCH', `api/CreditClassifications/1`).respond(200); + $httpBackend.expect('PATCH', `api/CreditClassifications/1`); controller.returnDialog('ACCEPT'); $httpBackend.flush(); diff --git a/modules/client/front/credit-insurance/insurance/create/index.html b/modules/client/front/credit-insurance/insurance/create/index.html index f6770b29a..7e93eeabd 100644 --- a/modules/client/front/credit-insurance/insurance/create/index.html +++ b/modules/client/front/credit-insurance/insurance/create/index.html @@ -1,4 +1,4 @@ - + diff --git a/modules/client/front/credit-insurance/insurance/index/index.js b/modules/client/front/credit-insurance/insurance/index/index.js index cfb8a807c..558cbab3a 100644 --- a/modules/client/front/credit-insurance/insurance/index/index.js +++ b/modules/client/front/credit-insurance/insurance/index/index.js @@ -19,7 +19,7 @@ class Controller { }; filter = encodeURIComponent(JSON.stringify(filter)); - let query = `/client/api/CreditClassifications?filter=${filter}`; + let query = `api/CreditClassifications?filter=${filter}`; this.$http.get(query).then(res => { if (res.data) this.isClosed = res.data[0].finished != null; diff --git a/modules/client/front/credit-insurance/insurance/index/index.spec.js b/modules/client/front/credit-insurance/insurance/index/index.spec.js index cb1d3d4ff..b7539c1c9 100644 --- a/modules/client/front/credit-insurance/insurance/index/index.spec.js +++ b/modules/client/front/credit-insurance/insurance/index/index.spec.js @@ -18,7 +18,7 @@ describe('Client', () => { describe('$onInit()', () => { it('should perform a query to GET credit the credit classification', () => { let res = [{finished: 'some value'}]; - let query = '/client/api/CreditClassifications?filter=%7B%22fields%22%3A%5B%22finished%22%5D%2C%22where%22%3A%7B%22id%22%3A1%7D%7D'; + let query = 'api/CreditClassifications?filter=%7B%22fields%22%3A%5B%22finished%22%5D%2C%22where%22%3A%7B%22id%22%3A1%7D%7D'; $httpBackend.whenGET(query).respond(res); $httpBackend.expectGET(query); diff --git a/modules/client/front/credit/create/index.html b/modules/client/front/credit/create/index.html index 02a55a8b7..d9db46f3c 100644 --- a/modules/client/front/credit/create/index.html +++ b/modules/client/front/credit/create/index.html @@ -1,4 +1,4 @@ - + { + this.$http.get(`api/Recoveries/${this.$state.params.id}/hasActiveRecovery`).then(res => { let activeRecovery = res.data; if (activeRecovery) this.$scope.confirmation.show(); diff --git a/modules/client/front/credit/create/index.spec.js b/modules/client/front/credit/create/index.spec.js index 0ac97275e..39d1332b0 100644 --- a/modules/client/front/credit/create/index.spec.js +++ b/modules/client/front/credit/create/index.spec.js @@ -37,16 +37,16 @@ describe('Client', () => { describe('onSubmit()', () => { it('should perform a query to check (GET) if the client has an active recovery', () => { - $httpBackend.whenGET(`/client/api/Recoveries/101/hasActiveRecovery`).respond(true); - $httpBackend.expectGET(`/client/api/Recoveries/101/hasActiveRecovery`); + $httpBackend.whenGET(`api/Recoveries/101/hasActiveRecovery`).respond(true); + $httpBackend.expectGET(`api/Recoveries/101/hasActiveRecovery`); controller.onSubmit(); $httpBackend.flush(); }); it('should call show() method when the client have a recovery', () => { spyOn(controller.$scope.confirmation, 'show'); - $httpBackend.whenGET(`/client/api/Recoveries/101/hasActiveRecovery`).respond(true); - $httpBackend.expectGET(`/client/api/Recoveries/101/hasActiveRecovery`); + $httpBackend.whenGET(`api/Recoveries/101/hasActiveRecovery`).respond(true); + $httpBackend.expectGET(`api/Recoveries/101/hasActiveRecovery`); controller.onSubmit(); $httpBackend.flush(); @@ -55,8 +55,8 @@ describe('Client', () => { it('should call addCredit() method when the client doesnt have a recovery', () => { spyOn(controller, 'addCredit'); - $httpBackend.whenGET(`/client/api/Recoveries/101/hasActiveRecovery`).respond(false); - $httpBackend.expectGET(`/client/api/Recoveries/101/hasActiveRecovery`); + $httpBackend.whenGET(`api/Recoveries/101/hasActiveRecovery`).respond(false); + $httpBackend.expectGET(`api/Recoveries/101/hasActiveRecovery`); controller.onSubmit(); $httpBackend.flush(); diff --git a/modules/client/front/credit/index/index.html b/modules/client/front/credit/index/index.html index 9757f8045..cbf456ded 100644 --- a/modules/client/front/credit/index/index.html +++ b/modules/client/front/credit/index/index.html @@ -1,6 +1,6 @@ { this.client = response.data; this.canceler = null; diff --git a/modules/client/front/descriptor-popover/index.spec.js b/modules/client/front/descriptor-popover/index.spec.js index 6d8e771a6..2204e6bdb 100644 --- a/modules/client/front/descriptor-popover/index.spec.js +++ b/modules/client/front/descriptor-popover/index.spec.js @@ -70,8 +70,8 @@ describe('Client', () => { controller.clientFk = 1; controller.canceler = null; let response = {}; - $httpBackend.when('GET', `/client/api/Clients/${controller._clientFk}/getCard`).respond(response); - $httpBackend.expect('GET', `/client/api/Clients/${controller._clientFk}/getCard`); + $httpBackend.when('GET', `api/Clients/${controller._clientFk}/getCard`).respond(response); + $httpBackend.expect('GET', `api/Clients/${controller._clientFk}/getCard`); controller.getCard(); $httpBackend.flush(); diff --git a/modules/client/front/dms/index/index.html b/modules/client/front/dms/index/index.html index c147a74e0..21ee93386 100644 --- a/modules/client/front/dms/index/index.html +++ b/modules/client/front/dms/index/index.html @@ -1,6 +1,6 @@ + { if (res.data) this.vnApp.showMessage(this.translate.instant('Equivalent tax spreaded')); diff --git a/modules/client/front/fiscal-data/index.spec.js b/modules/client/front/fiscal-data/index.spec.js index 63834f1c8..cfdc17457 100644 --- a/modules/client/front/fiscal-data/index.spec.js +++ b/modules/client/front/fiscal-data/index.spec.js @@ -20,8 +20,8 @@ describe('Client', () => { describe('returnDialogEt()', () => { it('should request to patch the propagation of tax status', () => { controller.client = {id: 123, isEqualizated: false}; - $httpBackend.when('PATCH', `/client/api/Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated}).respond('done'); - $httpBackend.expectPATCH(`/client/api/Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated}); + $httpBackend.when('PATCH', `api/Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated}).respond('done'); + $httpBackend.expectPATCH(`api/Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated}); controller.returnDialogEt('ACCEPT'); $httpBackend.flush(); }); diff --git a/modules/client/front/greuge/create/index.html b/modules/client/front/greuge/create/index.html index 7a6ea451b..897bbf3fd 100644 --- a/modules/client/front/greuge/create/index.html +++ b/modules/client/front/greuge/create/index.html @@ -1,4 +1,4 @@ - + diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html index 537e67602..02532fa0b 100644 --- a/modules/client/front/greuge/index/index.html +++ b/modules/client/front/greuge/index/index.html @@ -1,13 +1,13 @@ diff --git a/modules/client/front/index/index.html b/modules/client/front/index/index.html index d4bbcd198..2409a1fc7 100644 --- a/modules/client/front/index/index.html +++ b/modules/client/front/index/index.html @@ -1,6 +1,6 @@ + this.$scope.model.refresh() ); } diff --git a/modules/client/front/sample/create/index.html b/modules/client/front/sample/create/index.html index e8e56ba6f..73992aa70 100644 --- a/modules/client/front/sample/create/index.html +++ b/modules/client/front/sample/create/index.html @@ -1,4 +1,4 @@ - + @@ -23,7 +23,7 @@ vn-one field="$ctrl.clientSample.companyFk" model="ClientSample.companyFk" - url="/client/api/Companies" + url="api/Companies" show-field="code" value-field="id" label="Company" diff --git a/modules/client/front/sample/index/index.html b/modules/client/front/sample/index/index.html index 48543d135..99f6adc22 100644 --- a/modules/client/front/sample/index/index.html +++ b/modules/client/front/sample/index/index.html @@ -1,6 +1,6 @@ { + this.$http.post(`api/Sms/send`, this.sms).then(res => { this.vnApp.showMessage(this.$translate.instant('SMS sent!')); if (res.data) this.emit('send', {response: res.data}); diff --git a/modules/client/front/sms/index.spec.js b/modules/client/front/sms/index.spec.js index 3cb37093f..5a343a4a6 100644 --- a/modules/client/front/sms/index.spec.js +++ b/modules/client/front/sms/index.spec.js @@ -23,8 +23,8 @@ describe('Client', () => { controller.sms = {destinationFk: 101, destination: 111111111, message: 'My SMS'}; spyOn(controller.vnApp, 'showMessage'); - $httpBackend.when('POST', `/client/api/Sms/send`, params).respond(200, params); - $httpBackend.expect('POST', `/client/api/Sms/send`, params).respond(params); + $httpBackend.when('POST', `api/Sms/send`, params).respond(200, params); + $httpBackend.expect('POST', `api/Sms/send`, params).respond(params); controller.onResponse('ACCEPT'); $httpBackend.flush(); diff --git a/modules/client/front/summary/index.js b/modules/client/front/summary/index.js index a35f330f1..6263234d8 100644 --- a/modules/client/front/summary/index.js +++ b/modules/client/front/summary/index.js @@ -10,7 +10,7 @@ class Controller { if (!this.client) return; - this.$http.get(`/client/api/Clients/${this.client.id}/summary`).then(res => { + this.$http.get(`api/Clients/${this.client.id}/summary`).then(res => { if (res && res.data) { this.summary = res.data; diff --git a/modules/client/front/summary/index.spec.js b/modules/client/front/summary/index.spec.js index 71f78dad5..4c67e2bfe 100644 --- a/modules/client/front/summary/index.spec.js +++ b/modules/client/front/summary/index.spec.js @@ -20,8 +20,8 @@ describe('Client', () => { let res = {name: 'Superman', classifications: []}; spyOn(controller, 'sumRisk'); - $httpBackend.when('GET', `/client/api/Clients/101/summary`).respond(200, res); - $httpBackend.expect('GET', `/client/api/Clients/101/summary`); + $httpBackend.when('GET', `api/Clients/101/summary`).respond(200, res); + $httpBackend.expect('GET', `api/Clients/101/summary`); controller.$onChanges(); $httpBackend.flush(); diff --git a/modules/client/front/web-access/index.html b/modules/client/front/web-access/index.html index 40f9f77b9..2302b07c1 100644 --- a/modules/client/front/web-access/index.html +++ b/modules/client/front/web-access/index.html @@ -1,6 +1,6 @@ diff --git a/modules/client/front/web-access/index.js b/modules/client/front/web-access/index.js index 6282db5fb..2ef87d6dd 100644 --- a/modules/client/front/web-access/index.js +++ b/modules/client/front/web-access/index.js @@ -20,7 +20,7 @@ export default class Controller { isCustomer() { if (this.client.id) { - this.$http.get(`/client/api/Clients/${this.client.id}/hasCustomerRole`).then(res => { + this.$http.get(`api/Clients/${this.client.id}/hasCustomerRole`).then(res => { this.canChangePassword = res.data && res.data.isCustomer; }); } @@ -28,7 +28,7 @@ export default class Controller { checkConditions() { if (this.client.id) { - this.$http.get(`/client/api/Clients/${this.client.id}/isValidClient`).then(res => { + this.$http.get(`api/Clients/${this.client.id}/isValidClient`).then(res => { this.canEnableCheckBox = res.data; }); } @@ -51,7 +51,7 @@ export default class Controller { password: this.newPassword }; - this.$http.patch(`/client/api/Accounts/${this.client.id}`, account).then(res => { + this.$http.patch(`api/Accounts/${this.client.id}`, account).then(res => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); }); } catch (e) { diff --git a/modules/client/front/web-access/index.spec.js b/modules/client/front/web-access/index.spec.js index 5e24d9182..6be0bde5c 100644 --- a/modules/client/front/web-access/index.spec.js +++ b/modules/client/front/web-access/index.spec.js @@ -35,8 +35,8 @@ describe('Component VnClientWebAccess', () => { controller.client = {id: '1234'}; controller.isCustomer(); - $httpBackend.when('GET', `/client/api/Clients/${controller.client.id}/hasCustomerRole`).respond('ok'); - $httpBackend.expectGET(`/client/api/Clients/${controller.client.id}/hasCustomerRole`); + $httpBackend.when('GET', `api/Clients/${controller.client.id}/hasCustomerRole`).respond('ok'); + $httpBackend.expectGET(`api/Clients/${controller.client.id}/hasCustomerRole`); $httpBackend.flush(); }); }); @@ -47,8 +47,8 @@ describe('Component VnClientWebAccess', () => { expect(controller.canEnableCheckBox).toBeTruthy(); - $httpBackend.when('GET', `/client/api/Clients/${controller.client.id}/isValidClient`).respond(false); - $httpBackend.expectGET(`/client/api/Clients/${controller.client.id}/isValidClient`); + $httpBackend.when('GET', `api/Clients/${controller.client.id}/isValidClient`).respond(false); + $httpBackend.expectGET(`api/Clients/${controller.client.id}/isValidClient`); controller.checkConditions(); $httpBackend.flush(); @@ -73,8 +73,8 @@ describe('Component VnClientWebAccess', () => { controller.newPassword = 'm24x8'; controller.repeatPassword = 'm24x8'; controller.canChangePassword = true; - $httpBackend.when('PATCH', '/client/api/Accounts/1234').respond('done'); - $httpBackend.expectPATCH('/client/api/Accounts/1234', {password: 'm24x8'}); + $httpBackend.when('PATCH', 'api/Accounts/1234').respond('done'); + $httpBackend.expectPATCH('api/Accounts/1234', {password: 'm24x8'}); controller.onPassChange('ACCEPT'); $httpBackend.flush(); }); diff --git a/modules/client/front/web-payment/index.html b/modules/client/front/web-payment/index.html index cf7e8fbc2..e7f5c5191 100644 --- a/modules/client/front/web-payment/index.html +++ b/modules/client/front/web-payment/index.html @@ -1,6 +1,6 @@ diff --git a/modules/client/front/web-payment/index.js b/modules/client/front/web-payment/index.js index 0ec1a6858..8d15ad9a4 100644 --- a/modules/client/front/web-payment/index.js +++ b/modules/client/front/web-payment/index.js @@ -9,7 +9,7 @@ class Controller { } confirm(transaction) { - const path = '/client/api/Clients/confirmTransaction'; + const path = 'api/Clients/confirmTransaction'; let data = {id: transaction.id}; this.$http.post(path, data).then(res => { this.$scope.model.refresh(); diff --git a/modules/client/front/web-payment/index.spec.js b/modules/client/front/web-payment/index.spec.js index 861bb3da1..c998d0fa0 100644 --- a/modules/client/front/web-payment/index.spec.js +++ b/modules/client/front/web-payment/index.spec.js @@ -23,7 +23,7 @@ describe('Component vnClientWebPayment', () => { describe('confirm()', () => { it(`should confirm a transaction`, () => { let transaction = {id: 1}; - let query = '/client/api/Clients/confirmTransaction'; + let query = 'api/Clients/confirmTransaction'; controller.confirm(transaction); $httpBackend.when('POST', query, transaction).respond('ok'); diff --git a/modules/invoiceOut/front/descriptor/index.js b/modules/invoiceOut/front/descriptor/index.js index bd9891193..4bdad975e 100644 --- a/modules/invoiceOut/front/descriptor/index.js +++ b/modules/invoiceOut/front/descriptor/index.js @@ -67,7 +67,7 @@ class Controller { deleteInvoiceOut(response) { if (response === 'ACCEPT') { - const query = `/invoiceOut/api/InvoiceOuts/${this.invoiceOut.id}/delete`; + const query = `api/InvoiceOuts/${this.invoiceOut.id}/delete`; this.$http.post(query).then(() => { this.vnApp.showSuccess(this.$translate.instant('InvoiceOut deleted')); this.$state.go('invoiceOut.index'); @@ -77,7 +77,7 @@ class Controller { bookInvoiceOut(response) { if (response === 'ACCEPT') { - const query = `/invoiceOut/api/InvoiceOuts/${this.invoiceOut.ref}/book`; + const query = `api/InvoiceOuts/${this.invoiceOut.ref}/book`; this.$http.post(query).then(() => { this.vnApp.showSuccess(this.$translate.instant('InvoiceOut booked')); this.$state.reload(); diff --git a/modules/item/front/barcode/index.html b/modules/item/front/barcode/index.html index 14bde170b..74af3e1ae 100644 --- a/modules/item/front/barcode/index.html +++ b/modules/item/front/barcode/index.html @@ -1,6 +1,6 @@ @@ -19,7 +19,7 @@ info="Full name calculates based on tags 1-3. Is not recommended to change it manually"> @@ -33,7 +33,7 @@ vn-one initial-data="$ctrl.botanical.specie" field="$ctrl.botanical.specieFk" - url="/item/api/species" + url="api/species" show-field="latin_species_name" value-field="specie_id" label="Species"> diff --git a/modules/item/front/botanical/index.js b/modules/item/front/botanical/index.js index 92cea41aa..2d36fce7f 100644 --- a/modules/item/front/botanical/index.js +++ b/modules/item/front/botanical/index.js @@ -14,7 +14,7 @@ class Controller { where: {itemFk: this.$state.params.id}, include: [{relation: 'genus'}, {relation: 'specie'}] }; - this.$http.get(`/item/api/ItemBotanicals?filter=${JSON.stringify(filter)}`) + this.$http.get(`api/ItemBotanicals?filter=${JSON.stringify(filter)}`) .then(res => { if (res.data.length) this.botanical = res.data[0]; diff --git a/modules/item/front/botanical/index.spec.js b/modules/item/front/botanical/index.spec.js index 879701ddd..20140f622 100644 --- a/modules/item/front/botanical/index.spec.js +++ b/modules/item/front/botanical/index.spec.js @@ -22,8 +22,8 @@ describe('ItemBotanical', () => { describe('_getBotanical()', () => { it('should request to patch the propagation of botanical status', () => { - $httpBackend.whenGET('/item/api/ItemBotanicals?filter={"where":{"itemFk":123},"include":[{"relation":"genus"},{"relation":"specie"}]}').respond({data: 'item'}); - $httpBackend.expectGET('/item/api/ItemBotanicals?filter={"where":{"itemFk":123},"include":[{"relation":"genus"},{"relation":"specie"}]}'); + $httpBackend.whenGET('api/ItemBotanicals?filter={"where":{"itemFk":123},"include":[{"relation":"genus"},{"relation":"specie"}]}').respond({data: 'item'}); + $httpBackend.expectGET('api/ItemBotanicals?filter={"where":{"itemFk":123},"include":[{"relation":"genus"},{"relation":"specie"}]}'); controller.$onInit(); $httpBackend.flush(); }); diff --git a/modules/item/front/card/index.js b/modules/item/front/card/index.js index 9e11a7045..7f89c8d95 100644 --- a/modules/item/front/card/index.js +++ b/modules/item/front/card/index.js @@ -12,7 +12,7 @@ class Controller { } getCard() { - this.$http.get(`/item/api/Items/${this.$stateParams.id}/getCard`).then(response => { + this.$http.get(`api/Items/${this.$stateParams.id}/getCard`).then(response => { this.item = response.data; }); } diff --git a/modules/item/front/card/index.spec.js b/modules/item/front/card/index.spec.js index 6d4fa9832..01895caac 100644 --- a/modules/item/front/card/index.spec.js +++ b/modules/item/front/card/index.spec.js @@ -21,8 +21,8 @@ describe('Item', () => { describe('getCard()', () => { it('should request to set the item into the controller', () => { let response = {id: 123}; - $httpBackend.when('GET', `/item/api/Items/123/getCard`).respond(response); - $httpBackend.expect('GET', `/item/api/Items/123/getCard`); + $httpBackend.when('GET', `api/Items/123/getCard`).respond(response); + $httpBackend.expect('GET', `api/Items/123/getCard`); controller.getCard(); $httpBackend.flush(); diff --git a/modules/item/front/create/index.html b/modules/item/front/create/index.html index 7cb96a024..17dc61743 100644 --- a/modules/item/front/create/index.html +++ b/modules/item/front/create/index.html @@ -1,4 +1,4 @@ - + { this.item = response.data; this.canceler = null; diff --git a/modules/item/front/descriptor-popover/index.spec.js b/modules/item/front/descriptor-popover/index.spec.js index ffe744218..76c083a72 100644 --- a/modules/item/front/descriptor-popover/index.spec.js +++ b/modules/item/front/descriptor-popover/index.spec.js @@ -70,8 +70,8 @@ describe('Item', () => { controller.itemFk = 1; controller.canceler = null; let response = {}; - $httpBackend.when('GET', `/item/api/Items/${controller._itemFk}/getCard`).respond(response); - $httpBackend.expect('GET', `/item/api/Items/${controller._itemFk}/getCard`); + $httpBackend.when('GET', `api/Items/${controller._itemFk}/getCard`).respond(response); + $httpBackend.expect('GET', `api/Items/${controller._itemFk}/getCard`); controller.getCard(); $httpBackend.flush(); diff --git a/modules/item/front/descriptor/index.js b/modules/item/front/descriptor/index.js index da94aacb6..668d7c0b8 100644 --- a/modules/item/front/descriptor/index.js +++ b/modules/item/front/descriptor/index.js @@ -51,7 +51,7 @@ class Controller { warehouseFk: warehouseFk } }; - this.$http.get(`/item/api/Items/${this._item.id}/getVisibleAvailable`, options).then(response => { + this.$http.get(`api/Items/${this._item.id}/getVisibleAvailable`, options).then(response => { this.available = response.data.available; this.visible = response.data.visible; }); @@ -76,7 +76,7 @@ class Controller { saveRegularize(response) { if (response == 'ACCEPT') { - this.$http.post(`/item/api/Items/regularize`, { + this.$http.post(`api/Items/regularize`, { itemFk: this.item.id, quantity: this.quantity, warehouseFk: this.warehouseFk diff --git a/modules/item/front/diary/index.html b/modules/item/front/diary/index.html index 47506eed9..9f55b483e 100644 --- a/modules/item/front/diary/index.html +++ b/modules/item/front/diary/index.html @@ -1,6 +1,6 @@ @@ -11,7 +11,7 @@ { + this.$http.post(`api/Items/${this.itemSelected.id}/clone`).then(res => { if (res && res.data && res.data.id) this.$state.go('item.card.tags', {id: res.data.id}); }); diff --git a/modules/item/front/index/index.spec.js b/modules/item/front/index/index.spec.js index b90c62b9b..613e59556 100644 --- a/modules/item/front/index/index.spec.js +++ b/modules/item/front/index/index.spec.js @@ -47,8 +47,8 @@ describe('Item', () => { let response = 'ACCEPT'; controller.itemSelected = {id: 1}; - $httpBackend.when('POST', `/item/api/Items/1/clone`).respond({id: 99}); - $httpBackend.expect('POST', `/item/api/Items/1/clone`); + $httpBackend.when('POST', `api/Items/1/clone`).respond({id: 99}); + $httpBackend.expect('POST', `api/Items/1/clone`); controller.onCloneAccept(response); $httpBackend.flush(); diff --git a/modules/item/front/last-entries/index.html b/modules/item/front/last-entries/index.html index f6548079b..229c0cd5e 100644 --- a/modules/item/front/last-entries/index.html +++ b/modules/item/front/last-entries/index.html @@ -1,6 +1,6 @@ diff --git a/modules/item/front/niche/index.html b/modules/item/front/niche/index.html index e87034577..81d342ae3 100644 --- a/modules/item/front/niche/index.html +++ b/modules/item/front/niche/index.html @@ -1,6 +1,6 @@ + @@ -14,7 +14,7 @@ { + this.$http.get(`api/Items/${this.item.id}/getSummary`).then(response => { this.summary = response.data; }); } diff --git a/modules/item/front/summary/index.spec.js b/modules/item/front/summary/index.spec.js index 99a688554..31158fb18 100644 --- a/modules/item/front/summary/index.spec.js +++ b/modules/item/front/summary/index.spec.js @@ -18,8 +18,8 @@ describe('Item', () => { describe('getSummary()', () => { it('should perform a query to set summary', () => { let data = {id: 1, name: 'Gem of mind'}; - $httpBackend.when('GET', `/item/api/Items/1/getSummary`).respond(200, data); - $httpBackend.expect('GET', `/item/api/Items/1/getSummary`); + $httpBackend.when('GET', `api/Items/1/getSummary`).respond(200, data); + $httpBackend.expect('GET', `api/Items/1/getSummary`); controller.getSummary(); $httpBackend.flush(); diff --git a/modules/item/front/tags/index.html b/modules/item/front/tags/index.html index ad50ebe64..56e932558 100644 --- a/modules/item/front/tags/index.html +++ b/modules/item/front/tags/index.html @@ -1,6 +1,6 @@ diff --git a/modules/item/front/tax/index.html b/modules/item/front/tax/index.html index 8be5adeae..b8e9374e1 100644 --- a/modules/item/front/tax/index.html +++ b/modules/item/front/tax/index.html @@ -1,5 +1,5 @@ diff --git a/modules/item/front/tax/index.js b/modules/item/front/tax/index.js index f4cc6f73e..b27f4a674 100644 --- a/modules/item/front/tax/index.js +++ b/modules/item/front/tax/index.js @@ -22,7 +22,7 @@ export default class Controller { }; let urlFilter = encodeURIComponent(JSON.stringify(filter)); - let url = `/item/api/Items/${this.$stateParams.id}/taxes?filter=${urlFilter}`; + let url = `api/Items/${this.$stateParams.id}/taxes?filter=${urlFilter}`; this.$http.get(url).then(json => { this.taxes = json.data; }); @@ -33,7 +33,7 @@ export default class Controller { for (let tax of this.taxes) data.push({id: tax.id, taxClassFk: tax.taxClassFk}); - let url = `/item/api/Items/updateTaxes`; + let url = `api/Items/updateTaxes`; this.$http.post(url, data).then( () => this.vnApp.showSuccess(this._.instant('Data saved!')) ); diff --git a/modules/item/front/tax/index.spec.js b/modules/item/front/tax/index.spec.js index 56c3b9306..6f1679041 100644 --- a/modules/item/front/tax/index.spec.js +++ b/modules/item/front/tax/index.spec.js @@ -31,8 +31,8 @@ describe('Item', () => { }; let response = [{id: 1, taxClassFk: 1}]; filter = encodeURIComponent(JSON.stringify(filter)); - $httpBackend.when('GET', `/item/api/Items/1/taxes?filter=${filter}`).respond(response); - $httpBackend.expect('GET', `/item/api/Items/1/taxes?filter=${filter}`); + $httpBackend.when('GET', `api/Items/1/taxes?filter=${filter}`).respond(response); + $httpBackend.expect('GET', `api/Items/1/taxes?filter=${filter}`); controller.$onInit(); $httpBackend.flush(); @@ -51,12 +51,12 @@ describe('Item', () => { }; let response = [{id: 1, taxClassFk: 1}]; filter = encodeURIComponent(JSON.stringify(filter)); - $httpBackend.when('GET', `/item/api/Items/1/taxes?filter=${filter}`).respond(response); + $httpBackend.when('GET', `api/Items/1/taxes?filter=${filter}`).respond(response); controller.$onInit(); $httpBackend.flush(); - $httpBackend.when('POST', `/item/api/Items/updateTaxes`).respond('ok'); - $httpBackend.expect('POST', `/item/api/Items/updateTaxes`); + $httpBackend.when('POST', `api/Items/updateTaxes`).respond('ok'); + $httpBackend.expect('POST', `api/Items/updateTaxes`); controller.submit(); $httpBackend.flush(); diff --git a/modules/order/front/basic-data/index.html b/modules/order/front/basic-data/index.html index 7a76d937f..ad2495e9f 100644 --- a/modules/order/front/basic-data/index.html +++ b/modules/order/front/basic-data/index.html @@ -1,4 +1,4 @@ - + { if (res.data && res.data.rows) { if (res.data.rows.length == 0) @@ -66,7 +66,7 @@ class Controller { } getTotal() { - let query = `/order/api/Orders/${this.$state.params.id}/getTotal`; + let query = `api/Orders/${this.$state.params.id}/getTotal`; this.$http.get(query).then(res => { if (res.data) this.order.total = res.data; diff --git a/modules/order/front/card/index.spec.js b/modules/order/front/card/index.spec.js index 232886abd..ade22b0e3 100644 --- a/modules/order/front/card/index.spec.js +++ b/modules/order/front/card/index.spec.js @@ -23,7 +23,7 @@ describe('Order', () => { it(`should make a query, save the data in order and call get order if the response has data`, () => { spyOn(controller, 'getTotal'); let json = encodeURIComponent(JSON.stringify(controller.filter)); - $httpBackend.expectGET(`/order/api/Orders/${controller.$state.params.id}?filter=${json}`).respond({rows: [1, 2, 3]}); + $httpBackend.expectGET(`api/Orders/${controller.$state.params.id}?filter=${json}`).respond({rows: [1, 2, 3]}); controller.getCard(); $httpBackend.flush(); @@ -34,7 +34,7 @@ describe('Order', () => { it(`should make a query and not call getTotal if the response is not defined`, () => { spyOn(controller, 'getTotal'); let json = encodeURIComponent(JSON.stringify(controller.filter)); - $httpBackend.expectGET(`/order/api/Orders/${controller.$state.params.id}?filter=${json}`).respond(undefined); + $httpBackend.expectGET(`api/Orders/${controller.$state.params.id}?filter=${json}`).respond(undefined); controller.getCard(); $httpBackend.flush(); @@ -45,7 +45,7 @@ describe('Order', () => { describe('getTotal()', () => { it(`should make a query and save the data in order.total`, () => { - $httpBackend.expectGET(`/order/api/Orders/${controller.$state.params.id}/getTotal`).respond('20M'); + $httpBackend.expectGET(`api/Orders/${controller.$state.params.id}/getTotal`).respond('20M'); controller.getTotal(); $httpBackend.flush(); @@ -53,7 +53,7 @@ describe('Order', () => { }); it(`should make a query and not save the respones if is not defined`, () => { - $httpBackend.expectGET(`/order/api/Orders/${controller.$state.params.id}/getTotal`).respond(); + $httpBackend.expectGET(`api/Orders/${controller.$state.params.id}/getTotal`).respond(); controller.getTotal(); $httpBackend.flush(); diff --git a/modules/order/front/catalog/index.html b/modules/order/front/catalog/index.html index 118a5cda8..e83b98b31 100644 --- a/modules/order/front/catalog/index.html +++ b/modules/order/front/catalog/index.html @@ -1,6 +1,6 @@ { + this.$http.post(`api/Orders/new`, params).then(res => { this.vnApp.showSuccess(this.translate.instant('Data saved!')); this.$state.go('order.card.catalog', {id: res.data}); }); diff --git a/modules/order/front/create/card.spec.js b/modules/order/front/create/card.spec.js index e09d95a00..5deff2dda 100644 --- a/modules/order/front/create/card.spec.js +++ b/modules/order/front/create/card.spec.js @@ -92,8 +92,8 @@ describe('Order', () => { spyOn(controller.vnApp, 'showSuccess'); spyOn(controller.$state, 'go'); - $httpBackend.when('POST', 'order/api/Orders/new', {landed: 101, addressId: 101, agencyModeId: 101}).respond(200, 1); - $httpBackend.expect('POST', 'order/api/Orders/new', {landed: 101, addressId: 101, agencyModeId: 101}); + $httpBackend.when('POST', 'api/Orders/new', {landed: 101, addressId: 101, agencyModeId: 101}).respond(200, 1); + $httpBackend.expect('POST', 'api/Orders/new', {landed: 101, addressId: 101, agencyModeId: 101}); controller.createOrder(); $httpBackend.flush(); diff --git a/modules/order/front/filter/index.html b/modules/order/front/filter/index.html index d4d8fd751..96c4c1840 100644 --- a/modules/order/front/filter/index.html +++ b/modules/order/front/filter/index.html @@ -1,6 +1,6 @@ diff --git a/modules/order/front/line/index.js b/modules/order/front/line/index.js index a3e9f77ad..38de2b878 100644 --- a/modules/order/front/line/index.js +++ b/modules/order/front/line/index.js @@ -33,7 +33,7 @@ class Controller { {relation: 'warehouse'}] }; filter = encodeURIComponent(JSON.stringify(filter)); - let query = `/order/api/OrderRows?filter=${filter}`; + let query = `api/OrderRows?filter=${filter}`; this.$http.get(query).then(res => { this.rows = res.data; @@ -41,7 +41,7 @@ class Controller { } getVAT() { - let query = `/order/api/Orders/${this.$state.params.id}/getVAT`; + let query = `api/Orders/${this.$state.params.id}/getVAT`; this.$http.get(query).then(res => { this.VAT = res.data; @@ -65,7 +65,7 @@ class Controller { rows: this.idsToRemove, actualOrderId: this.$state.params.id }; - let query = `/order/api/OrderRows/removes`; + let query = `api/OrderRows/removes`; this.$http.post(query, params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); diff --git a/modules/order/front/line/index.spec.js b/modules/order/front/line/index.spec.js index 56b53ddb8..295113e78 100644 --- a/modules/order/front/line/index.spec.js +++ b/modules/order/front/line/index.spec.js @@ -35,7 +35,7 @@ describe('Order', () => { }; filter = encodeURIComponent(JSON.stringify(filter)); - $httpBackend.expectGET(`/order/api/OrderRows?filter=${filter}`).respond({data: [{id: 1}]}); + $httpBackend.expectGET(`api/OrderRows?filter=${filter}`).respond({data: [{id: 1}]}); controller.getRows(); $httpBackend.flush(); }); @@ -43,7 +43,7 @@ describe('Order', () => { describe('getVAT()', () => { it('should make a query to get the VAT of a given order', () => { - $httpBackend.expectGET(`/order/api/Orders/1/getVAT`).respond({data: {tax: 3}}); + $httpBackend.expectGET(`api/Orders/1/getVAT`).respond({data: {tax: 3}}); controller.getVAT(); $httpBackend.flush(); }); @@ -57,7 +57,7 @@ describe('Order', () => { spyOn(controller.card, 'reload'); controller.deleteRow('ACCEPT'); - $httpBackend.expectPOST(`/order/api/OrderRows/removes`).respond(); + $httpBackend.expectPOST(`api/OrderRows/removes`).respond(); $httpBackend.flush(); expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!'); diff --git a/modules/order/front/prices-popover/index.js b/modules/order/front/prices-popover/index.js index 826535ba9..b306521fd 100644 --- a/modules/order/front/prices-popover/index.js +++ b/modules/order/front/prices-popover/index.js @@ -33,7 +33,7 @@ class Controller { tooltip: 'Diary' } }; - this.$http.get(`/item/api/ItemTags?filter=${JSON.stringify(filter)}`).then(response => { + this.$http.get(`api/ItemTags?filter=${JSON.stringify(filter)}`).then(response => { this.tags = response.data; this.$.$applyAsync(() => { this.$.popover.relocate(); @@ -125,7 +125,7 @@ class Controller { items: filledLines }; - this.$http.post(`/order/api/OrderRows/addToOrder`, params).then(res => { + this.$http.post(`api/OrderRows/addToOrder`, params).then(res => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.$.popover.hide(); this.card.reload(); diff --git a/modules/order/front/search-panel/index.html b/modules/order/front/search-panel/index.html index 953524625..84edae23f 100644 --- a/modules/order/front/search-panel/index.html +++ b/modules/order/front/search-panel/index.html @@ -26,14 +26,14 @@ vn-one label="Agency" field="filter.agencyModeFk" - url="/agency/api/AgencyModes/isActive" + url="api/AgencyModes/isActive" show-field="name" value-field="id"> diff --git a/modules/order/front/summary/index.js b/modules/order/front/summary/index.js index 19323e4bb..0dfd468fc 100644 --- a/modules/order/front/summary/index.js +++ b/modules/order/front/summary/index.js @@ -10,7 +10,7 @@ class Controller { } setSummary() { - this.$http.get(`/order/api/Orders/${this.order.id}/summary`).then(res => { + this.$http.get(`api/Orders/${this.order.id}/summary`).then(res => { if (res && res.data) this.summary = res.data; }); diff --git a/modules/order/front/summary/index.spec.js b/modules/order/front/summary/index.spec.js index 171b23a83..51415251a 100644 --- a/modules/order/front/summary/index.spec.js +++ b/modules/order/front/summary/index.spec.js @@ -18,8 +18,8 @@ describe('Order', () => { describe('getSummary()', () => { it('should perform a GET query and define summary property', () => { let res = {id: 1, nickname: 'Batman'}; - $httpBackend.when('GET', `/order/api/Orders/1/summary`).respond(200, res); - $httpBackend.expect('GET', `/order/api/Orders/1/summary`); + $httpBackend.when('GET', `api/Orders/1/summary`).respond(200, res); + $httpBackend.expect('GET', `api/Orders/1/summary`); controller.setSummary(); $httpBackend.flush(); diff --git a/modules/order/front/volume/index.html b/modules/order/front/volume/index.html index e368e9c1b..b6de504f6 100644 --- a/modules/order/front/volume/index.html +++ b/modules/order/front/volume/index.html @@ -1,12 +1,12 @@ - + diff --git a/modules/order/front/volume/index.js b/modules/order/front/volume/index.js index 3275b0b5c..01b27c1b3 100644 --- a/modules/order/front/volume/index.js +++ b/modules/order/front/volume/index.js @@ -16,7 +16,7 @@ class Controller { } onDataChange() { - this.$http.get(`/order/api/Orders/${this.$stateParams.id}/getVolumes`) + this.$http.get(`api/Orders/${this.$stateParams.id}/getVolumes`) .then(response => { if (response.data) this.$scope.model.data.forEach(order => { diff --git a/modules/order/front/volume/index.spec.js b/modules/order/front/volume/index.spec.js index d18fde6d6..f85ade6ec 100644 --- a/modules/order/front/volume/index.spec.js +++ b/modules/order/front/volume/index.spec.js @@ -28,8 +28,8 @@ describe('Order', () => { it('should join the sale volumes to its respective sale', () => { let response = {volumes: [{itemFk: 1, volume: 0.008}, {itemFk: 2, volume: 0.003}]}; - $httpBackend.whenGET(`/order/api/Orders/1/getVolumes`).respond(response); - $httpBackend.expectGET(`/order/api/Orders/1/getVolumes`); + $httpBackend.whenGET(`api/Orders/1/getVolumes`).respond(response); + $httpBackend.expectGET(`api/Orders/1/getVolumes`); controller.onDataChange(); $httpBackend.flush(); diff --git a/modules/route/front/card/index.js b/modules/route/front/card/index.js index 9182d9cdc..3573de7ea 100644 --- a/modules/route/front/card/index.js +++ b/modules/route/front/card/index.js @@ -46,7 +46,7 @@ export default class Controller { getCard() { let json = encodeURIComponent(JSON.stringify(this.filter)); - this.$http.get(`/client/api/Routes?filter=${json}`).then(response => { + this.$http.get(`api/Routes?filter=${json}`).then(response => { this.route = response.data[0]; }); } diff --git a/modules/route/front/descriptor/index.js b/modules/route/front/descriptor/index.js index 15472726e..631a86c4d 100644 --- a/modules/route/front/descriptor/index.js +++ b/modules/route/front/descriptor/index.js @@ -54,7 +54,7 @@ class Controller { updateVolume(response) { if (response === 'ACCEPT') { - let url = `/route/api/Routes/${this.route.id}/updateVolume`; + let url = `api/Routes/${this.route.id}/updateVolume`; this.$http.post(url).then(() => { this.vnApp.showSuccess(this.$translate.instant('Volume updated')); this.card.reload(); diff --git a/modules/route/front/search-panel/index.html b/modules/route/front/search-panel/index.html index f19f88ee6..2f834ddb6 100644 --- a/modules/route/front/search-panel/index.html +++ b/modules/route/front/search-panel/index.html @@ -13,7 +13,7 @@ @@ -44,7 +44,7 @@ vn-one label="Vehicle" field="filter.vehicleFk" - url="/route/api/Vehicles" + url="api/Vehicles" show-field="numberPlate" value-field="id"> @@ -59,7 +59,7 @@ vn-one label="Warehouse" field="filter.warehouseFk" - url="/route/api/Warehouses" + url="api/Warehouses" show-field="name" value-field="id"> diff --git a/modules/route/front/tickets/index.js b/modules/route/front/tickets/index.js index ce12d88ac..c10a0cc42 100644 --- a/modules/route/front/tickets/index.js +++ b/modules/route/front/tickets/index.js @@ -81,7 +81,7 @@ class Controller { } updateVolume() { - let url = `/route/api/Routes/${this.$stateParams.id}/updateVolume`; + let url = `api/Routes/${this.$stateParams.id}/updateVolume`; this.$http.post(url).then(() => { this.card.reload(); this.$.model.refresh(); diff --git a/modules/ticket/front/basic-data/step-three/index.html b/modules/ticket/front/basic-data/step-three/index.html index 4208aaf8d..2e4d3ff3d 100644 --- a/modules/ticket/front/basic-data/step-three/index.html +++ b/modules/ticket/front/basic-data/step-three/index.html @@ -2,7 +2,7 @@ { if (res.data) { this.ticket = res.data; @@ -60,7 +60,7 @@ class Controller { } getDebt(id) { - const query = `/ticket/api/Clients/${id}/getDebt`; + const query = `api/Clients/${id}/getDebt`; this.$http.get(query).then(res => { if (res.data) this.ticket.client.debt = res.data.debt; diff --git a/modules/ticket/front/card/index.spec.js b/modules/ticket/front/card/index.spec.js index 7b9f7088f..2c9fa1472 100644 --- a/modules/ticket/front/card/index.spec.js +++ b/modules/ticket/front/card/index.spec.js @@ -23,10 +23,10 @@ describe('Ticket', () => { filter = encodeURIComponent(JSON.stringify(filter)); - $httpBackend.when('GET', `/ticket/api/Tickets/1?filter=${filter}`).respond({id: 1, client: {id: 1}}); - $httpBackend.expect('GET', `/ticket/api/Tickets/1?filter=${filter}`); - $httpBackend.when('GET', `/ticket/api/Clients/1/getDebt`).respond(); - $httpBackend.expect('GET', `/ticket/api/Clients/1/getDebt`); + $httpBackend.when('GET', `api/Tickets/1?filter=${filter}`).respond({id: 1, client: {id: 1}}); + $httpBackend.expect('GET', `api/Tickets/1?filter=${filter}`); + $httpBackend.when('GET', `api/Clients/1/getDebt`).respond(); + $httpBackend.expect('GET', `api/Clients/1/getDebt`); controller.getCard(); $httpBackend.flush(); diff --git a/modules/ticket/front/component/index.html b/modules/ticket/front/component/index.html index 228a0270c..def434ca2 100644 --- a/modules/ticket/front/component/index.html +++ b/modules/ticket/front/component/index.html @@ -1,6 +1,6 @@ diff --git a/modules/ticket/front/create/card.js b/modules/ticket/front/create/card.js index c0321e3d5..17d4690a3 100644 --- a/modules/ticket/front/create/card.js +++ b/modules/ticket/front/create/card.js @@ -109,7 +109,7 @@ class Controller { agencyModeFk: this.ticket.agencyModeFk, warehouseFk: this.ticket.warehouseFk, }; - this.$http.post(`ticket/api/Tickets/new`, params).then(res => { + this.$http.post(`api/Tickets/new`, params).then(res => { this.vnApp.showSuccess(this.translate.instant('Data saved!')); this.$state.go('ticket.card.summary', {id: res.data.id}); }); diff --git a/modules/ticket/front/descriptor-popover/index.js b/modules/ticket/front/descriptor-popover/index.js index 1c8b997a7..dddfba544 100644 --- a/modules/ticket/front/descriptor-popover/index.js +++ b/modules/ticket/front/descriptor-popover/index.js @@ -97,7 +97,7 @@ class Controller extends Component { ] }; let json = encodeURIComponent(JSON.stringify(filter)); - let query = `/ticket/api/Tickets/${this._ticketFk}?filter=${json}`; + let query = `api/Tickets/${this._ticketFk}?filter=${json}`; this.$http.get(query, options).then( response => { this.ticket = response.data; diff --git a/modules/ticket/front/descriptor-popover/index.spec.js b/modules/ticket/front/descriptor-popover/index.spec.js index a7b4a92e2..5760c28da 100644 --- a/modules/ticket/front/descriptor-popover/index.spec.js +++ b/modules/ticket/front/descriptor-popover/index.spec.js @@ -115,8 +115,8 @@ describe('ticket Component vnTicketDescriptorPopover', () => { ] }; let json = encodeURIComponent(JSON.stringify(filter)); - $httpBackend.when('GET', `/ticket/api/Tickets/${controller._ticketFk}?filter=${json}`).respond(response); - $httpBackend.expect('GET', `/ticket/api/Tickets/${controller._ticketFk}?filter=${json}`); + $httpBackend.when('GET', `api/Tickets/${controller._ticketFk}?filter=${json}`).respond(response); + $httpBackend.expect('GET', `api/Tickets/${controller._ticketFk}?filter=${json}`); controller.getCard(); $httpBackend.flush(); diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index 0453a55b2..c85f39696 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -53,7 +53,7 @@ class Controller { changeShipped(response) { if (response === 'ACCEPT') { let data = {shipped: this.newShipped}; - let query = `/ticket/api/Tickets/${this.ticket.id}/updateEditableTicket`; + let query = `api/Tickets/${this.ticket.id}/updateEditableTicket`; this.$http.post(query, data).then(() => { this.vnApp.showSuccess(this.$translate.instant('Shipped hour updated')); this.cardReload(); @@ -122,7 +122,7 @@ class Controller { addTurn(day) { let params = {ticketFk: this.ticket.id, weekDay: day}; - this.$http.patch(`/ticket/api/TicketWeeklies`, params).then(() => { + this.$http.patch(`api/TicketWeeklies`, params).then(() => { this.$scope.addTurn.hide(); this.vnApp.showSuccess(this.$translate.instant('Data saved!')); }); @@ -236,7 +236,7 @@ class Controller { */ makeInvoice(response) { if (response === 'ACCEPT') { - const query = `/ticket/api/Tickets/${this.ticket.id}/makeInvoice`; + const query = `api/Tickets/${this.ticket.id}/makeInvoice`; this.$http.post(query).then(() => { this.vnApp.showSuccess(this.$translate.instant('Ticket invoiced')); this.$state.reload(); @@ -260,7 +260,7 @@ class Controller { regenerateInvoice(response) { if (response === 'ACCEPT') { const invoiceId = this.ticket.invoiceOut.id; - const query = `/invoiceOut/api/InvoiceOuts/${invoiceId}/regenerate`; + const query = `api/InvoiceOuts/${invoiceId}/regenerate`; this.$http.post(query).then(() => { const snackbarMessage = this.$translate.instant( `Invoice sent for a regeneration, will be available in a few minutes`); diff --git a/modules/ticket/front/descriptor/index.spec.js b/modules/ticket/front/descriptor/index.spec.js index 6fc167a41..f049a6903 100644 --- a/modules/ticket/front/descriptor/index.spec.js +++ b/modules/ticket/front/descriptor/index.spec.js @@ -40,7 +40,7 @@ describe('Ticket Component vnTicketDescriptor', () => { controller.$scope.addTurn = {hide: () => {}}; spyOn(controller.$scope.addTurn, 'hide'); - $httpBackend.expectPATCH(`/ticket/api/TicketWeeklies`).respond(); + $httpBackend.expectPATCH(`api/TicketWeeklies`).respond(); controller.addTurn(1); $httpBackend.flush(); @@ -96,8 +96,8 @@ describe('Ticket Component vnTicketDescriptor', () => { spyOn(controller.$state, 'reload'); spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.when('POST', '/ticket/api/Tickets/2/makeInvoice').respond(); - $httpBackend.expect('POST', '/ticket/api/Tickets/2/makeInvoice').respond(); + $httpBackend.when('POST', 'api/Tickets/2/makeInvoice').respond(); + $httpBackend.expect('POST', 'api/Tickets/2/makeInvoice').respond(); controller.makeInvoice('ACCEPT'); $httpBackend.flush(); @@ -110,8 +110,8 @@ describe('Ticket Component vnTicketDescriptor', () => { it('should make a query and show a success snackbar if the response is ACCEPT', () => { spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.when('POST', '/invoiceOut/api/InvoiceOuts/1/regenerate').respond(); - $httpBackend.expect('POST', '/invoiceOut/api/InvoiceOuts/1/regenerate').respond(); + $httpBackend.when('POST', 'api/InvoiceOuts/1/regenerate').respond(); + $httpBackend.expect('POST', 'api/InvoiceOuts/1/regenerate').respond(); controller.regenerateInvoice('ACCEPT'); $httpBackend.flush(); @@ -125,8 +125,8 @@ describe('Ticket Component vnTicketDescriptor', () => { spyOn(controller.vnApp, 'showSuccess'); spyOn(controller, 'cardReload'); - $httpBackend.when('POST', '/ticket/api/Tickets/12/updateEditableTicket').respond(); - $httpBackend.expect('POST', '/ticket/api/Tickets/12/updateEditableTicket').respond(); + $httpBackend.when('POST', 'api/Tickets/12/updateEditableTicket').respond(); + $httpBackend.expect('POST', 'api/Tickets/12/updateEditableTicket').respond(); controller.changeShipped('ACCEPT'); $httpBackend.flush(); diff --git a/modules/ticket/front/dms/index/index.html b/modules/ticket/front/dms/index/index.html index ce0dde211..ce606a2dd 100644 --- a/modules/ticket/front/dms/index/index.html +++ b/modules/ticket/front/dms/index/index.html @@ -1,6 +1,6 @@ diff --git a/modules/ticket/front/expedition/index.js b/modules/ticket/front/expedition/index.js index 74d22a792..8e5c5cc31 100644 --- a/modules/ticket/front/expedition/index.js +++ b/modules/ticket/front/expedition/index.js @@ -14,7 +14,7 @@ class Controller { returnDialog(response) { if (response === 'ACCEPT') { - this.$http.delete(`/ticket/api/Expeditions/${this.expeditionId}`).then( + this.$http.delete(`api/Expeditions/${this.expeditionId}`).then( () => this.$.model.refresh() ); } diff --git a/modules/ticket/front/expedition/index.spec.js b/modules/ticket/front/expedition/index.spec.js index c20f5e0ea..c5ae12671 100644 --- a/modules/ticket/front/expedition/index.spec.js +++ b/modules/ticket/front/expedition/index.spec.js @@ -28,8 +28,8 @@ describe('Ticket', () => { let response = 'ACCEPT'; controller.expeditionId = 1; - $httpBackend.when('DELETE', `/ticket/api/Expeditions/1`).respond(200); - $httpBackend.expect('DELETE', `/ticket/api/Expeditions/1`); + $httpBackend.when('DELETE', `api/Expeditions/1`).respond(200); + $httpBackend.expect('DELETE', `api/Expeditions/1`); controller.returnDialog(response); $httpBackend.flush(); diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 5d05bd7c5..1bcbd9fc4 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -1,6 +1,6 @@ diff --git a/modules/ticket/front/package/index.html b/modules/ticket/front/package/index.html index e774012c5..7257093b9 100644 --- a/modules/ticket/front/package/index.html +++ b/modules/ticket/front/package/index.html @@ -17,7 +17,7 @@ + diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 70fa24e63..77aa0c8ce 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -54,7 +54,7 @@ diff --git a/modules/ticket/front/summary/index.js b/modules/ticket/front/summary/index.js index 2bdbe7fef..e1b1d1f9b 100644 --- a/modules/ticket/front/summary/index.js +++ b/modules/ticket/front/summary/index.js @@ -30,7 +30,7 @@ class Controller { } getSummary() { - this.$http.get(`/ticket/api/Tickets/${this.ticket.id}/summary`).then(res => { + this.$http.get(`api/Tickets/${this.ticket.id}/summary`).then(res => { if (res && res.data) this.summary = res.data; }); @@ -76,7 +76,7 @@ class Controller { params.code = 'OK'; - this.$http.post(`/ticket/api/TicketTrackings/changeState`, params).then(() => { + this.$http.post(`api/TicketTrackings/changeState`, params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); if (this.card) this.card.reload(); diff --git a/modules/ticket/front/summary/index.spec.js b/modules/ticket/front/summary/index.spec.js index 4653c80a4..ccf6f3ffc 100644 --- a/modules/ticket/front/summary/index.spec.js +++ b/modules/ticket/front/summary/index.spec.js @@ -18,8 +18,8 @@ describe('Ticket', () => { describe('ticket()', () => { it('should perform a GET query and define summary property', () => { let res = {id: 1, nickname: 'Batman'}; - $httpBackend.when('GET', `/ticket/api/Tickets/1/summary`).respond(200, res); - $httpBackend.expect('GET', `/ticket/api/Tickets/1/summary`); + $httpBackend.when('GET', `api/Tickets/1/summary`).respond(200, res); + $httpBackend.expect('GET', `api/Tickets/1/summary`); controller.ticket = {id: 1}; $httpBackend.flush(); diff --git a/modules/ticket/front/tracking/edit/index.html b/modules/ticket/front/tracking/edit/index.html index e7368ba7a..79ad70ab7 100644 --- a/modules/ticket/front/tracking/edit/index.html +++ b/modules/ticket/front/tracking/edit/index.html @@ -10,13 +10,13 @@ - + diff --git a/modules/ticket/front/weekly/index/index.html b/modules/ticket/front/weekly/index/index.html index 51f40c9eb..10646c561 100644 --- a/modules/ticket/front/weekly/index/index.html +++ b/modules/ticket/front/weekly/index/index.html @@ -1,6 +1,6 @@ { + this.$http.patch('api/TicketWeeklies/', params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); }); } @@ -77,7 +77,7 @@ export default class Controller { returnDialog(response) { const ticket = this.$.model.data[this.ticketIndex]; if (response === 'ACCEPT') { - this.$http.delete(`/ticket/api/TicketWeeklies/${ticket.ticketFk}`).then(() => { + this.$http.delete(`api/TicketWeeklies/${ticket.ticketFk}`).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.$.model.remove(this.ticketIndex); }); diff --git a/modules/travel/front/index/index.html b/modules/travel/front/index/index.html index c7f2a6d6e..cc7a07207 100644 --- a/modules/travel/front/index/index.html +++ b/modules/travel/front/index/index.html @@ -1,6 +1,6 @@ @@ -51,14 +51,14 @@ diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index d1b042619..988004d32 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -24,7 +24,7 @@ class Controller { ended: this.ended }}; - let query = `/worker/api/WorkerCalendars/absences`; + let query = `api/WorkerCalendars/absences`; this.$http.get(query, params).then(res => { if (!res.data) return; diff --git a/modules/worker/front/calendar/index.spec.js b/modules/worker/front/calendar/index.spec.js index 90c50ba01..623e058e3 100644 --- a/modules/worker/front/calendar/index.spec.js +++ b/modules/worker/front/calendar/index.spec.js @@ -74,8 +74,8 @@ describe('Worker', () => { started: controller.started, ended: controller.ended }); - $httpBackend.when('GET', `/worker/api/WorkerCalendars/absences?${params}`).respond(expectedData); - $httpBackend.expect('GET', `/worker/api/WorkerCalendars/absences?${params}`); + $httpBackend.when('GET', `api/WorkerCalendars/absences?${params}`).respond(expectedData); + $httpBackend.expect('GET', `api/WorkerCalendars/absences?${params}`); controller.worker = worker; diff --git a/modules/worker/front/department/index.html b/modules/worker/front/department/index.html index 6cf2cd063..8824d8349 100644 --- a/modules/worker/front/department/index.html +++ b/modules/worker/front/department/index.html @@ -1,6 +1,6 @@ diff --git a/modules/worker/front/department/index.js b/modules/worker/front/department/index.js index 2047c06c7..c3a4a75ed 100644 --- a/modules/worker/front/department/index.js +++ b/modules/worker/front/department/index.js @@ -50,7 +50,7 @@ class Controller { if (!this.newNode.name) throw new Error(`Name can't be empty`); - this.$http.post(`/worker/api/Departments/nodeAdd`, this.newNode).then(response => { + this.$http.post(`api/Departments/nodeAdd`, this.newNode).then(response => { if (response.data) { let parent = this.selectedNode.parent; if ((parent instanceof Object) && !(parent instanceof Array)) { @@ -70,7 +70,7 @@ class Controller { onRemoveResponse(response) { if (response === 'ACCEPT') { - const path = `/worker/api/Departments/nodeDelete`; + const path = `api/Departments/nodeDelete`; this.$http.post(path, {parentFk: this.selectedNode.id}).then(() => { let parent = this.selectedNode.parent; diff --git a/modules/worker/front/index/index.html b/modules/worker/front/index/index.html index 3c254e7f7..cfbece2cf 100644 --- a/modules/worker/front/index/index.html +++ b/modules/worker/front/index/index.html @@ -1,6 +1,6 @@ diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index 1aeb70304..0bdddef95 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -1,6 +1,6 @@