mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 09:05:45 -06:00
32 lines
651 B
TypeScript
32 lines
651 B
TypeScript
import coreModule from 'app/core/core_module';
|
|
|
|
export class UserInviteCtrl {
|
|
navModel: any;
|
|
invite: any;
|
|
inviteForm: any;
|
|
|
|
/** @ngInject */
|
|
constructor(private backendSrv, navModelSrv, private $location) {
|
|
this.navModel = navModelSrv.getNav('cfg', 'users', 0);
|
|
|
|
this.invite = {
|
|
name: '',
|
|
email: '',
|
|
role: 'Editor',
|
|
sendEmail: true,
|
|
};
|
|
}
|
|
|
|
sendInvite() {
|
|
if (!this.inviteForm.$valid) {
|
|
return;
|
|
}
|
|
|
|
return this.backendSrv.post('/api/org/invites', this.invite).then(() => {
|
|
this.$location.path('org/users/');
|
|
});
|
|
}
|
|
}
|
|
|
|
coreModule.controller('UserInviteCtrl', UserInviteCtrl);
|