mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
27 lines
607 B
TypeScript
27 lines
607 B
TypeScript
import coreModule from 'app/core/core_module';
|
|
|
|
export class CreateTeamCtrl {
|
|
name: string;
|
|
email: string;
|
|
navModel: any;
|
|
|
|
/** @ngInject */
|
|
constructor(private backendSrv, private $location, navModelSrv) {
|
|
this.navModel = navModelSrv.getNav('cfg', 'teams', 0);
|
|
}
|
|
|
|
create() {
|
|
const payload = {
|
|
name: this.name,
|
|
email: this.email,
|
|
};
|
|
this.backendSrv.post('/api/teams', payload).then(result => {
|
|
if (result.teamId) {
|
|
this.$location.path('/org/teams/edit/' + result.teamId);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
coreModule.controller('CreateTeamCtrl', CreateTeamCtrl);
|