2020-03-09 08:00:03 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import ModuleCard from 'salix/components/module-card';
|
|
|
|
import './style.scss';
|
|
|
|
|
|
|
|
class Controller extends ModuleCard {
|
|
|
|
reload() {
|
|
|
|
const filter = {
|
2023-04-27 13:06:05 +00:00
|
|
|
where: {id: this.$params.id},
|
2020-03-09 08:00:03 +00:00
|
|
|
include: {
|
|
|
|
relation: 'role',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
return Promise.all([
|
2023-04-27 13:06:05 +00:00
|
|
|
this.$http.get(`VnUsers/preview`, {filter})
|
|
|
|
.then(res => {
|
|
|
|
const [user] = res.data;
|
|
|
|
this.user = user;
|
|
|
|
}),
|
2023-01-31 13:57:24 +00:00
|
|
|
this.$http.get(`Accounts/${this.$params.id}/exists`)
|
2020-03-09 08:00:03 +00:00
|
|
|
.then(res => this.hasAccount = res.data.exists)
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnUserCard', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|