salix/modules/account/front/card/index.js

33 lines
878 B
JavaScript
Raw Normal View History

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},
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`)
.then(res => this.hasAccount = res.data.exists)
]);
}
}
ngModule.vnComponent('vnUserCard', {
template: require('./index.html'),
controller: Controller
});