salix/modules/shelving/front/descriptor/index.js

27 lines
635 B
JavaScript
Raw Normal View History

2022-05-24 10:50:22 +00:00
import ngModule from '../module';
import Descriptor from 'salix/components/descriptor';
class Controller extends Descriptor {
get shelving() {
return this.entity;
}
set shelving(value) {
this.entity = value;
}
onDelete() {
return this.$http.delete(`Shelvings/${this.shelving.id}`)
.then(() => this.$state.go('shelving.index'))
.then(() => this.vnApp.showSuccess(this.$t('Shelving removed')));
}
}
ngModule.vnComponent('vnShelvingDescriptor', {
template: require('./index.html'),
controller: Controller,
bindings: {
shelving: '<'
}
});