refactor
This commit is contained in:
parent
144cb3ee63
commit
26e95bfa56
|
@ -1,31 +0,0 @@
|
|||
import ngModule from '../module';
|
||||
|
||||
class Controller {
|
||||
constructor($scope, $element) {
|
||||
this.$ = $scope;
|
||||
this.ticket = {};
|
||||
}
|
||||
show() {
|
||||
this.$.dialog.show();
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.$.dialog.hide();
|
||||
}
|
||||
|
||||
onResponse(response) {
|
||||
this.$.ticketCreate.createTicket().then(res => {
|
||||
this.callback({res});
|
||||
});
|
||||
}
|
||||
}
|
||||
Controller.$inject = ['$scope'];
|
||||
|
||||
ngModule.component('vnTicketCreateDialog', {
|
||||
template: require('./create-dialog.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
ticket: '<?',
|
||||
callback: '&'
|
||||
}
|
||||
});
|
|
@ -111,16 +111,14 @@ class Controller {
|
|||
showDeleteTicketDialog() {
|
||||
this.$.deleteConfirmation.show();
|
||||
}
|
||||
returnDeleteTicketDialog(response) {
|
||||
if (response === 'ACCEPT')
|
||||
this.deleteTicket();
|
||||
}
|
||||
deleteTicket() {
|
||||
let params = {id: this.$state.params.id};
|
||||
this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => {
|
||||
this.$state.go('ticket.index');
|
||||
this.vnApp.showSuccess(this.translate.instant('Ticket deleted'));
|
||||
});
|
||||
deleteTicket(response) {
|
||||
if (response === 'ACCEPT') {
|
||||
let params = {id: this.$state.params.id};
|
||||
this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => {
|
||||
this.$state.go('ticket.index');
|
||||
this.vnApp.showSuccess(this.translate.instant('Ticket deleted'));
|
||||
});
|
||||
}
|
||||
}
|
||||
// Remove Lines
|
||||
onRemoveLinesClick(response) {
|
||||
|
|
Loading…
Reference in New Issue