import ngModule from '../module';
import Section from 'salix/components/section';

export default class Controller extends Section {
    onSynchronizeAll() {
        this.vnApp.showSuccess(this.$t('Synchronizing in the background'));
        this.$http.patch(`Accounts/syncAll`);
    }

    onSynchronizeRoles() {
        this.$http.patch(`RoleInherits/sync`)
            .then(() => this.vnApp.showSuccess(this.$t('Roles synchronized!')));
    }
}

ngModule.component('vnAccountAccounts', {
    template: require('./index.html'),
    controller: Controller
});