module removed from api path
gitea/salix/master This commit looks good Details

This commit is contained in:
Juan Ferrer 2019-12-08 14:42:59 +01:00
parent 34ff3048c9
commit 982832d29b
174 changed files with 331 additions and 331 deletions

View File

@ -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()
);

View File

@ -1,4 +1,4 @@
<mg-ajax path="/agency/api/Zones/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<mg-ajax path="api/Zones/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.zone"
@ -18,7 +18,7 @@
<vn-autocomplete
vn-one
field="$ctrl.zone.warehouseFk"
url="/agency/api/Warehouses"
url="api/Warehouses"
show-field="name"
value-field="id"
label="Warehouse"
@ -27,7 +27,7 @@
<vn-autocomplete
vn-one
field="$ctrl.zone.agencyModeFk"
url="/agency/api/AgencyModes"
url="api/AgencyModes"
show-field="name"
value-field="id"
label="Agency"

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/agency/api/ZoneCalendars"
url="api/ZoneCalendars"
link="{zoneFk: $ctrl.$stateParams.id}"
data="$ctrl.data"
primary-key="zoneFk"

View File

@ -18,7 +18,7 @@ class Controller {
]
};
let json = encodeURIComponent(JSON.stringify(filter));
let query = `/agency/api/Zones/${this.$stateParams.id}?filter=${json}`;
let query = `api/Zones/${this.$stateParams.id}?filter=${json}`;
this.$http.get(query).then(res => {
if (res.data)
this.zone = res.data;

View File

@ -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();

View File

@ -1,4 +1,4 @@
<mg-ajax path="/agency/api/Zones" options="vnPost"></mg-ajax>
<mg-ajax path="api/Zones" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.zone"
@ -17,14 +17,14 @@
<vn-horizontal>
<vn-autocomplete vn-one
field="$ctrl.zone.warehouseFk"
url="/agency/api/Warehouses"
url="api/Warehouses"
show-field="name"
value-field="id"
label="Warehouse">
</vn-autocomplete>
<vn-autocomplete vn-one
field="$ctrl.zone.agencyModeFk"
url="/agency/api/AgencyModes/isActive"
url="api/AgencyModes/isActive"
show-field="name"
value-field="id"
label="Agency">

View File

@ -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');
});
}

View File

@ -1,4 +1,4 @@
<mg-ajax path="/agency/api/Zones/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<mg-ajax path="api/Zones/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.zone"
@ -17,7 +17,7 @@
<vn-autocomplete
vn-one
field="$ctrl.zone.warehouseFk"
url="/agency/api/Warehouses"
url="api/Warehouses"
show-field="name"
value-field="id"
label="Warehouse">
@ -25,7 +25,7 @@
<vn-autocomplete
vn-one
field="$ctrl.zone.agencyModeFk"
url="/agency/api/AgencyModes/isActive"
url="api/AgencyModes/isActive"
show-field="name"
value-field="id"
label="Agency">

View File

@ -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});

View File

@ -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">
</vn-autocomplete>
@ -28,7 +28,7 @@
vn-one
label="Warehouse"
field="filter.warehouseFk"
url="/agency/api/Warehouses"
url="api/Warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/agency/api/ZoneCalendars"
url="api/ZoneCalendars"
fields="['zoneFk', 'delivered']"
link="{zoneFk: $ctrl.$stateParams.id}"
data="$ctrl.data"

View File

@ -30,7 +30,7 @@ class Controller {
if (!value) return;
let query = '/agency/api/LabourHolidays/getByWarehouse';
let query = 'api/LabourHolidays/getByWarehouse';
this.$http.get(query, {params: {warehouseFk: value.warehouseFk}}).then(res => {
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;
});
}

View File

@ -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);
}

View File

@ -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">
</vn-autocomplete>
@ -29,7 +29,7 @@
vn-one
label="Warehouse"
field="filter.warehouseFk"
url="/agency/api/Warehouses"
url="api/Warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -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;
});

View File

@ -1,6 +1,6 @@
<vn-crud-model auto-load="false"
vn-id="model"
url="claim/api/ClaimEnds"
url="api/ClaimEnds"
filter="$ctrl.filter"
data="$ctrl.salesClaimed">
</vn-crud-model>
@ -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 @@
</vn-dialog>
<vn-crud-model
vn-id="lastTicketsModel"
url="/claim/api/Tickets"
url="api/Tickets"
limit="20"
data="lastTickets" auto-load="false">
</vn-crud-model>

View File

@ -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}`,

View File

@ -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();

View File

@ -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 @@
<vn-autocomplete
vn-one
field="$ctrl.claim.claimStateFk"
url="/claim/api/ClaimStates"
url="api/ClaimStates"
show-field="description"
value-field="id"
label="Claim state"

View File

@ -61,7 +61,7 @@ class Controller {
getCard() {
let json = encodeURIComponent(JSON.stringify(this.filter));
let query = `/claim/api/Claims/${this.$state.params.id}?filter=${json}`;
let query = `api/Claims/${this.$state.params.id}?filter=${json}`;
this.$http.get(query).then(res => {
if (res.data)
this.claim = res.data;

View File

@ -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();

View File

@ -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');
});

View File

@ -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();

View File

@ -1,7 +1,7 @@
<vn-crud-model
auto-load="false"
vn-id="model"
url="claim/api/ClaimBeginnings"
url="api/ClaimBeginnings"
filter="$ctrl.filter"
data="$ctrl.salesClaimed"
on-data-change="$ctrl.calculateTotals()">

View File

@ -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();

View File

@ -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();

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="claim/api/ClaimDevelopments"
url="api/ClaimDevelopments"
fields="['id', 'claimFk', 'claimReasonFk', 'claimResultFk', 'claimResponsibleFk', 'workerFk', 'claimRedeliveryFk']"
link="{claimFk: $ctrl.$state.params.id}"
filter="$ctrl.filter"
@ -8,25 +8,25 @@
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimReasons"
url="api/ClaimReasons"
data="claimReasons"
order="description"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimResults"
url="api/ClaimResults"
data="claimResults"
order="description"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimResponsibles"
url="api/ClaimResponsibles"
data="claimResponsibles"
order="description"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimRedeliveries"
url="api/ClaimRedeliveries"
data="claimRedeliveries"
order="description"
auto-load="true">

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/claim/api/Claims/filter"
url="api/Claims/filter"
limit="20"
data="claims"
order="claimStateFk ASC, created DESC">

View File

@ -32,7 +32,7 @@
<vn-autocomplete
vn-one
field="filter.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
url="api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
@ -42,7 +42,7 @@
<vn-autocomplete
vn-one
field="filter.attenderFk"
url="/client/api/Clients/activeWorkersWithRole"
url="api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
@ -54,7 +54,7 @@
<vn-autocomplete vn-one
label="State"
field="filter.claimStateFk"
url="/claim/api/ClaimStates"
url="api/ClaimStates"
show-field="description"
value-field="id">
<tpl-item>{{description}}</tpl-item>

View File

@ -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;
});
}

View File

@ -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();

View File

@ -1,6 +1,6 @@
<vn-watcher
vn-id="watcher"
url="/client/api/Addresses/createDefaultAddress"
url="api/Addresses/createDefaultAddress"
id-field="id"
data="$ctrl.data"
save="post"
@ -8,7 +8,7 @@
</vn-watcher>
<vn-crud-model
vn-id="model"
url="/client/api/AddressObservations"
url="api/AddressObservations"
fields="['id', 'addressFk', 'observationTypeFk', 'description']"
link="{addressFk: $ctrl.$stateParams.addressId}"
data="observations"

View File

@ -1,26 +1,26 @@
<mg-ajax
path="/client/api/Addresses/{{edit.params.addressId}}"
path="api/Addresses/{{edit.params.addressId}}"
actions="$ctrl.address = edit.model"
options="mgEdit">
</mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.address"
url="/client/api/Addresses"
url="api/Addresses"
id-field="id"
form="form">
</vn-watcher>
<vn-crud-model
vn-id="model"
url="/client/api/AddressObservations"
url="api/AddressObservations"
fields="['id', 'addressFk', 'observationTypeFk', 'description']"
link="{addressFk: $ctrl.$stateParams.addressId}"
data="observations"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="/client/api/ObservationTypes"
url="api/ObservationTypes"
fields="['id', 'description']"
data="types"
auto-load="true">
@ -85,7 +85,7 @@
<vn-autocomplete vn-one
initial-data="$ctrl.address.agencyMode"
field="$ctrl.address.agencyModeFk"
url="/client/api/AgencyModes/isActive"
url="api/AgencyModes/isActive"
show-field="name"
value-field="id"
label="Agency">

View File

@ -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) {

View File

@ -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();

View File

@ -2,7 +2,7 @@
vn-id="dialog"
class="modal-form">
<tpl-body>
<mg-ajax path="/client/api/receipts" options="vnPost"></mg-ajax>
<mg-ajax path="api/receipts" options="vnPost"></mg-ajax>
<vn-horizontal class="header">
<h5><span translate>New payment</span></h5>
</vn-horizontal>

View File

@ -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();

View File

@ -1,13 +1,13 @@
<vn-crud-model
vn-id="model"
url="/client/api/receipts/filter"
url="api/receipts/filter"
params="$ctrl.params"
limit="20"
data="$ctrl.balances">
</vn-crud-model>
<vn-crud-model
vn-id="riskModel"
url="/client/api/ClientRisks"
url="api/ClientRisks"
filter="$ctrl.filter"
data="$ctrl.clientRisks">
</vn-crud-model>
@ -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">

View File

@ -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;

View File

@ -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();

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/Clients/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<mg-ajax path="api/Clients/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.client"
@ -44,7 +44,7 @@
<vn-autocomplete
vn-one
field="$ctrl.client.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
url="api/Clients/activeWorkersWithRole"
show-field="nickname"
search-function="{firstName: $search}"
value-field="id"
@ -55,7 +55,7 @@
<vn-autocomplete
vn-one
field="$ctrl.client.contactChannelFk"
url="/client/api/ContactChannels"
url="api/ContactChannels"
label="Channel">
</vn-autocomplete>
</vn-horizontal>

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/Clients/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<mg-ajax path="api/Clients/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.client"
@ -13,7 +13,7 @@
label="Billing data"
vn-acl="salesAssistant"
field="$ctrl.client.payMethodFk"
url="/client/api/PayMethods"
url="api/PayMethods"
fields="['ibanRequired']"
initial-data="$ctrl.client.payMethod">
</vn-autocomplete>
@ -33,7 +33,7 @@
</vn-textfield>
<vn-autocomplete vn-one
label="Swift / BIC"
url="/client/api/BankEntities"
url="api/BankEntities"
field="$ctrl.client.bankEntityFk"
fields="['name']"
initial-data="$ctrl.client.bankEntityFk"
@ -108,7 +108,7 @@
label="Country"
field="$ctrl.newBankEntity.countryFk"
fields="['id', 'country', 'code']"
url="/client/api/Countries"
url="api/Countries"
value-field="id"
show-field="country"
required="true">

View File

@ -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)

View File

@ -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();

View File

@ -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;
});
}

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/ClientContacts"
url="api/ClientContacts"
fields="['id', 'name', 'phone', 'clientFk']"
link="{clientFk: $ctrl.$stateParams.id}"
data="contacts"

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/Clients/createWithUser" options="vnPost"></mg-ajax>
<mg-ajax path="api/Clients/createWithUser" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.client"
@ -12,7 +12,7 @@
<vn-textfield vn-two label="Comercial Name" field="$ctrl.client.name" vn-focus></vn-textfield>
<vn-autocomplete vn-one
field="$ctrl.client.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
url="api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
show-field="firstName"
value-field="id"

View File

@ -16,7 +16,7 @@ class Controller {
if (this.$scope.form.$invalid)
return this.vnApp.showError(this.$translate.instant('Some fields are invalid'));
let query = `/client/api/creditClassifications/createWithInsurance`;
let query = `api/creditClassifications/createWithInsurance`;
let data = this.creditClassification;
data.clientFk = this.client.id;

View File

@ -39,8 +39,8 @@ describe('Client', () => {
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();
});

View File

@ -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);
});
}

View File

@ -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();

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/CreditClassifications/{{post.params.classificationId}}/insurances" options="vnPost"></mg-ajax>
<mg-ajax path="api/CreditClassifications/{{post.params.classificationId}}/insurances" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.insurance"

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/CreditInsurances"
url="api/CreditInsurances"
link="{creditClassification: $ctrl.$stateParams.classificationId}"
limit="20"
data="insurances" auto-load="false">

View File

@ -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;

View File

@ -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);

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/Clients/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<mg-ajax path="api/Clients/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.client"

View File

@ -8,7 +8,7 @@ class Controller {
}
onSubmit() {
this.$http.get(`/client/api/Recoveries/${this.$state.params.id}/hasActiveRecovery`).then(res => {
this.$http.get(`api/Recoveries/${this.$state.params.id}/hasActiveRecovery`).then(res => {
let activeRecovery = res.data;
if (activeRecovery)
this.$scope.confirmation.show();

View File

@ -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();

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/ClientCredits"
url="api/ClientCredits"
filter="::$ctrl.filter"
link="{clientFk: $ctrl.$stateParams.id}"
limit="20"

View File

@ -51,7 +51,7 @@ class Controller extends Component {
this.canceler = this.$q.defer();
let options = {timeout: this.canceler.promise};
this.$http.get(`/client/api/Clients/${this._clientFk}/getCard`, options).then(
this.$http.get(`api/Clients/${this._clientFk}/getCard`, options).then(
response => {
this.client = response.data;
this.canceler = null;

View File

@ -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();

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/ClientDms"
url="api/ClientDms"
link="{clientFk: $ctrl.$stateParams.id}"
filter="::$ctrl.filter"
limit="20"

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/Clients/{{patch.params.id}}/updateFiscalData" options="vnPatch"></mg-ajax>
<mg-ajax path="api/Clients/{{patch.params.id}}/updateFiscalData" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.client"

View File

@ -48,7 +48,7 @@ export default class Controller {
returnDialogEt(response) {
if (response === 'ACCEPT') {
this.$http.patch(`/client/api/Clients/${this.client.id}/addressesPropagateRe`, {isEqualizated: this.client.isEqualizated}).then(
this.$http.patch(`api/Clients/${this.client.id}/addressesPropagateRe`, {isEqualizated: this.client.isEqualizated}).then(
res => {
if (res.data)
this.vnApp.showMessage(this.translate.instant('Equivalent tax spreaded'));

View File

@ -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();
});

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/greuges" options="vnPost"></mg-ajax>
<mg-ajax path="api/greuges" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.greuge"
@ -28,7 +28,7 @@
<vn-autocomplete
vn-one
field="$ctrl.greuge.greugeTypeFk"
url="/client/api/greugeTypes"
url="api/greugeTypes"
label="Type">
</vn-autocomplete>
</vn-horizontal>

View File

@ -1,13 +1,13 @@
<vn-crud-model
vn-id="model"
url="/client/api/greuges"
url="api/greuges"
filter="::$ctrl.filter"
link="{clientFk: $ctrl.$stateParams.id}"
limit="20"
data="greuges" auto-load="true">
</vn-crud-model>
<mg-ajax
path="/client/api/greuges/{{$ctrl.$stateParams.id}}/sumAmount"
path="api/greuges/{{$ctrl.$stateParams.id}}/sumAmount"
options="mgEdit">
</mg-ajax>
<vn-vertical compact>

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/item/api/Clients"
url="api/Clients"
order="id DESC"
limit="8"
data="clients"

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/Mandates"
url="api/Mandates"
filter="::$ctrl.filter"
link="{clientFk: $ctrl.$stateParams.id}"
limit="20"

View File

@ -1,6 +1,6 @@
<vn-watcher
vn-id="watcher"
url="/client/api/ClientObservations"
url="api/ClientObservations"
id-field="id"
data="$ctrl.note"
save="post"

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/clientObservations"
url="api/clientObservations"
filter="$ctrl.filter"
link="{clientFk: $ctrl.$stateParams.id}"
data="notes"

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/recoveries" options="vnPost"></mg-ajax>
<mg-ajax path="api/recoveries" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.recovery"

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/Recoveries"
url="api/Recoveries"
filter="{}"
link="{clientFk: $ctrl.$stateParams.id}"
limit="20"

View File

@ -10,7 +10,7 @@ class Controller {
setFinished(recovery) {
if (!recovery.finished) {
let params = {finished: Date.now()};
this.$http.patch(`/client/api/Recoveries/${recovery.id}`, params).then(
this.$http.patch(`api/Recoveries/${recovery.id}`, params).then(
() => this.$scope.model.refresh()
);
}

View File

@ -1,4 +1,4 @@
<mg-ajax path="/client/api/ClientSamples" options="vnPost"></mg-ajax>
<mg-ajax path="api/ClientSamples" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.clientSample"
@ -14,7 +14,7 @@
field="$ctrl.clientSample.typeFk"
model="ClientSample.typeFk"
fields="['code','hasCompany']"
url="/client/api/Samples/visible"
url="api/Samples/visible"
show-field="description"
value-field="id"
label="Sample">
@ -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"

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/ClientSamples"
url="api/ClientSamples"
filter="::$ctrl.filter"
link="{clientFk: $ctrl.$stateParams.id}"
limit="20"

View File

@ -29,7 +29,7 @@
<vn-autocomplete
vn-one
field="filter.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
url="api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
show-field="firstName"
value-field="id"

View File

@ -18,7 +18,7 @@ class Controller extends Component {
onResponse(response) {
if (response === 'ACCEPT') {
this.$http.post(`/client/api/Sms/send`, this.sms).then(res => {
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});

View File

@ -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();

View File

@ -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;

View File

@ -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();

View File

@ -1,6 +1,6 @@
<vn-watcher
vn-id="watcher"
url="/client/api/Accounts"
url="api/Accounts"
id-field="id"
data="$ctrl.account"
form="form">

View File

@ -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) {

View File

@ -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();
});

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/client/api/clients/getTransactions"
url="api/clients/getTransactions"
link="{clientFk: $ctrl.$stateParams.id}"
limit="20"
data="transactions" auto-load="false">

View File

@ -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();

View File

@ -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');

View File

@ -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();

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="/item/api/ItemBarcodes"
url="api/ItemBarcodes"
fields="['id', 'itemFk', 'code']"
link="{itemFk: $ctrl.$stateParams.id}"
data="barcodes"

View File

@ -1,5 +1,5 @@
<mg-ajax
path="/item/api/Items/{{patch.params.id}}"
path="api/Items/{{patch.params.id}}"
options="vnPatch"
override="{filter: {include: [{relation: 'itemType'}, {relation: 'origin'}, {relation: 'ink'}, {relation: 'producer'}, {relation: 'expence'}]}}">
</mg-ajax>
@ -19,7 +19,7 @@
info="Full name calculates based on tags 1-3. Is not recommended to change it manually">
</vn-textfield>
<vn-autocomplete vn-one
url="/item/api/ItemTypes"
url="api/ItemTypes"
label="Type"
show-field="name"
value-field="id"
@ -29,7 +29,7 @@
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
url="/item/api/Intrastats"
url="api/Intrastats"
label="Intrastat"
show-field="description"
value-field="id"
@ -42,13 +42,13 @@
</tpl-item>
</vn-autocomplete>
<vn-autocomplete vn-one
url="/item/api/Expences"
url="api/Expences"
label="Expence"
field="$ctrl.item.expenceFk"
initial-data="$ctrl.item.expence">
</vn-autocomplete>
<vn-autocomplete vn-one
url="/item/api/Origins"
url="api/Origins"
label="Origin"
show-field="name"
value-field="id"

View File

@ -1,5 +1,5 @@
<mg-ajax
path="/item/api/ItemBotanicals"
path="api/ItemBotanicals"
options="vnPatch">
</mg-ajax>
<vn-watcher
@ -24,7 +24,7 @@
vn-one
initial-data="$ctrl.botanical.genus"
field="$ctrl.botanical.genusFk"
url="/item/api/genera"
url="api/genera"
show-field="latin_genus_name"
value-field="genus_id"
label="Genus">
@ -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">

View File

@ -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];

View File

@ -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();
});

View File

@ -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;
});
}

View File

@ -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();

View File

@ -1,4 +1,4 @@
<mg-ajax path="/item/api/Items/new" options="vnPost"></mg-ajax>
<mg-ajax path="api/Items/new" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.item"
@ -18,7 +18,7 @@
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
url="/item/api/ItemTypes"
url="api/ItemTypes"
label="Type"
fields="['code', 'name']"
value-field="id"
@ -30,7 +30,7 @@
</tpl-item>
</vn-autocomplete>
<vn-autocomplete vn-one
url="/item/api/Intrastats"
url="api/Intrastats"
label="Intrastat"
show-field="description"
value-field="id"
@ -44,7 +44,7 @@
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
url="/item/api/Origins"
url="api/Origins"
label="Origin"
show-field="name"
value-field="id"

View File

@ -60,7 +60,7 @@ class Controller extends Component {
this.canceler = this.$q.defer();
let options = {timeout: this.canceler.promise};
this.$http.get(`/item/api/Items/${this._itemFk}/getCard`, options).then(
this.$http.get(`api/Items/${this._itemFk}/getCard`, options).then(
response => {
this.item = response.data;
this.canceler = null;

View File

@ -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();

View File

@ -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

View File

@ -1,6 +1,6 @@
<vn-crud-model
vn-id="model"
url="item/api/Items/getDiary"
url="api/Items/getDiary"
filter="$ctrl.filter"
data="sales"
auto-load="false">
@ -11,7 +11,7 @@
<vn-horizontal>
<vn-autocomplete
vn-focus
url="/item/api/Warehouses"
url="api/Warehouses"
show-field="name"
value-field="id"
initial-data="$ctrl.warehouseFk"

Some files were not shown because too many files have changed in this diff Show More