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

29 lines
770 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 = {
include: {
relation: 'role',
scope: {
fields: ['id', 'name']
}
}
};
return Promise.all([
this.$http.get(`Accounts/${this.$params.id}`, {filter})
.then(res => this.user = res.data),
this.$http.get(`UserAccounts/${this.$params.id}/exists`)
.then(res => this.hasAccount = res.data.exists)
]);
}
}
ngModule.vnComponent('vnUserCard', {
template: require('./index.html'),
controller: Controller
});