removed service name from end points
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-05-27 08:46:11 +02:00
parent c08dee7df0
commit 16c8d2fd2a
2 changed files with 11 additions and 11 deletions

View File

@ -208,7 +208,7 @@ class Controller {
let sales = this.getCheckedLines();
for (let i = 0; i < sales.length; i++)
sales[i].quantity = this.sales[sales[i].instance].quantity;
this.$http.post(`claim/api/Claims/createFromSales`, {claim: claim, sales: sales}).then(res => {
this.$http.post(`/api/Claims/createFromSales`, {claim: claim, sales: sales}).then(res => {
this.$state.go('claim.card.basicData', {id: res.data.id});
});
}
@ -260,7 +260,7 @@ class Controller {
updatePrice() {
if (this.editedPrice != this.sale.price) {
this.$http.post(`/ticket/api/Sales/updatePrice`, {id: this.edit.id, price: this.editedPrice, ticketFk: this.ticket.id}).then(() => {
this.$http.post(`/api/Sales/updatePrice`, {id: this.edit.id, price: this.editedPrice, ticketFk: this.ticket.id}).then(() => {
this.sale.price = this.edit.price;
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
this.$scope.model.refresh();
@ -299,7 +299,7 @@ class Controller {
}
updateQuantity(id, quantity) {
this.$http.post(`/ticket/api/Sales/${id}/updateQuantity`, {quantity: parseInt(quantity)}).then(() => {
this.$http.post(`/api/Sales/${id}/updateQuantity`, {quantity: parseInt(quantity)}).then(() => {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
}).catch(e => {
this.vnApp.showError(e.data.error.message);
@ -326,7 +326,7 @@ class Controller {
let sales = this.getCheckedLines();
let params = {sales: sales, ticketFk: this.ticket.id, reserved: reserved};
this.$http.post(`/ticket/api/Sales/reserve`, params).then(() => {
this.$http.post(`/api/Sales/reserve`, params).then(() => {
this.$scope.model.refresh();
});
}

View File

@ -45,8 +45,8 @@ describe('Ticket', () => {
$httpBackend = _$httpBackend_;
$httpBackend.whenGET(/api\/Tickets\/1\/getSales.*/).respond(sales);
$httpBackend.whenGET(`/ticket/api/Tickets/1/getVAT`).respond(200, 10.5);
$httpBackend.whenGET(`/ticket/api/Tickets/1/subtotal`).respond(200, 227.5);
$httpBackend.whenGET(`/api/Tickets/1/getVAT`).respond(200, 10.5);
$httpBackend.whenGET(`/api/Tickets/1/subtotal`).respond(200, 227.5);
$element = $compile('<vn-ticket-sale ticket="ticket"></vn-ticket-sale>')($scope);
controller = $element.controller('vnTicketSale');
@ -65,7 +65,7 @@ describe('Ticket', () => {
spyOn(controller.$state, 'go');
let res = {id: 1};
$httpBackend.expectPOST(`claim/api/Claims/createFromSales`).respond(res);
$httpBackend.expectPOST(`/api/Claims/createFromSales`).respond(res);
controller.createClaim();
$httpBackend.flush();
@ -106,7 +106,7 @@ describe('Ticket', () => {
let res = [{id: 3}];
spyOn(controller, 'onStateChange');
$httpBackend.whenGET(`/ticket/api/States?filter=${filter}`).respond(res);
$httpBackend.whenGET(`/api/States?filter=${filter}`).respond(res);
controller.onStateOkClick();
$httpBackend.flush();
@ -116,7 +116,7 @@ describe('Ticket', () => {
describe('onStateChange()', () => {
it('should perform a post and then call a function', () => {
$httpBackend.expectPOST(`/ticket/api/TicketTrackings/changeState`).respond();
$httpBackend.expectPOST(`/api/TicketTrackings/changeState`).respond();
controller.onStateChange(3);
$httpBackend.flush();
});
@ -126,7 +126,7 @@ describe('Ticket', () => {
it('should call getCheckedLines, call removeInstances, and make a query', () => {
controller.sales[1].checked = true;
$httpBackend.whenPOST(`/ticket/api/Sales/removes`).respond();
$httpBackend.whenPOST(`/api/Sales/removes`).respond();
controller.onRemoveLinesClick('ACCEPT');
$httpBackend.flush();
@ -166,7 +166,7 @@ describe('Ticket', () => {
reserved: false
};
$httpBackend.expectPOST(`/ticket/api/Sales/reserve`, expectedRequest).respond();
$httpBackend.expectPOST(`/api/Sales/reserve`, expectedRequest).respond();
controller.unmarkAsReserved(false);
$httpBackend.flush();
});