grafana/public/app/features/org/newOrgCtrl.js
2015-10-30 14:19:02 +01:00

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';
});
});
};
});
});