Merge pull request 'fix: refs #244936 sale redirect catalog to lilium' (!3266) from 244936-hotFixRedirectToCatalog into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #3266 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
ecd86b2b5a
|
@ -387,10 +387,10 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
newOrderFromTicket() {
|
newOrderFromTicket() {
|
||||||
this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(res => {
|
this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(async res => {
|
||||||
const path = this.$state.href('order.card.catalog', {id: res.data});
|
const path = await this.vnApp.getUrl(`order/${res.data}/catalog`);
|
||||||
window.open(path, '_blank');
|
|
||||||
|
|
||||||
|
window.open(path, '_blank');
|
||||||
this.vnApp.showSuccess(this.$t('Order created'));
|
this.vnApp.showSuccess(this.$t('Order created'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -567,14 +567,10 @@ describe('Ticket', () => {
|
||||||
const expectedResponse = {id: 123};
|
const expectedResponse = {id: 123};
|
||||||
|
|
||||||
window.open = jasmine.createSpy('open');
|
window.open = jasmine.createSpy('open');
|
||||||
controller.$state.href = jasmine.createSpy('href')
|
|
||||||
.and.returnValue('/somePath');
|
|
||||||
|
|
||||||
$httpBackend.expect('POST', `Orders/newFromTicket`, expectedParams).respond(expectedResponse);
|
$httpBackend.expect('POST', `Orders/newFromTicket`, expectedParams).respond(expectedResponse);
|
||||||
controller.newOrderFromTicket();
|
controller.newOrderFromTicket();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
expect(window.open).toHaveBeenCalledWith('/somePath', '_blank');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue