29 lines
765 B
JavaScript
29 lines
765 B
JavaScript
import ngModule from '../module';
|
|
import ModuleCard from 'salix/components/module-card';
|
|
import './style.scss';
|
|
|
|
class Controller extends ModuleCard {
|
|
reload() {
|
|
const filter = {
|
|
include: {
|
|
relation: 'role',
|
|
scope: {
|
|
fields: ['id', 'name']
|
|
}
|
|
}
|
|
};
|
|
|
|
return Promise.all([
|
|
this.$http.get(`VnUsers/${this.$params.id}`, {filter})
|
|
.then(res => this.user = res.data),
|
|
this.$http.get(`Accounts/${this.$params.id}/exists`)
|
|
.then(res => this.hasAccount = res.data.exists)
|
|
]);
|
|
}
|
|
}
|
|
|
|
ngModule.vnComponent('vnUserCard', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|