Merge pull request '2724 - Fix: Create new service type' (#511) from 2724-ticket_service_fix into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #511 Reviewed-by: Carlos Jimenez Ruiz <carlosjr@verdnatura.es>
This commit is contained in:
commit
e4c5ebf615
|
@ -6,6 +6,7 @@
|
|||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
vn-id="typesModel"
|
||||
auto-load="true"
|
||||
url="TicketServiceTypes"
|
||||
data="ticketServiceTypes"
|
||||
|
|
|
@ -35,6 +35,10 @@ class Controller extends Section {
|
|||
throw new UserError(`Name can't be empty`);
|
||||
|
||||
return this.$http.post(`TicketServiceTypes`, this.$.newServiceType)
|
||||
.then(res => {
|
||||
this.$.typesModel.refresh();
|
||||
return res;
|
||||
})
|
||||
.then(res => service.ticketServiceTypeFk = res.data.id);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import './index.js';
|
||||
import crudModel from 'core/mocks/crud-model';
|
||||
|
||||
describe('Ticket component vnTicketService', () => {
|
||||
let controller;
|
||||
|
@ -11,7 +12,7 @@ describe('Ticket component vnTicketService', () => {
|
|||
beforeEach(inject(($componentController, _$httpBackend_, $rootScope) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
$scope = $rootScope.$new();
|
||||
|
||||
$scope.typesModel = crudModel;
|
||||
$element = angular.element(`<div></div>`);
|
||||
controller = $componentController('vnTicketService', {$scope, $element});
|
||||
}));
|
||||
|
|
Loading…
Reference in New Issue