mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
24 lines
541 B
JavaScript
24 lines
541 B
JavaScript
define([
|
|
'angular',
|
|
'app/core/config',
|
|
],
|
|
function (angular, config) {
|
|
'use strict';
|
|
|
|
var module = angular.module('grafana.controllers');
|
|
|
|
module.controller('NewOrgCtrl', function($scope, $http, backendSrv) {
|
|
|
|
$scope.newOrg = {name: ''};
|
|
|
|
$scope.createOrg = function() {
|
|
backendSrv.post('/api/orgs/', $scope.newOrg).then(function(result) {
|
|
backendSrv.post('/api/user/using/' + result.orgId).then(function() {
|
|
window.location.href = config.appSubUrl + '/org';
|
|
});
|
|
});
|
|
};
|
|
|
|
});
|
|
});
|