mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Updated org creation view, after creating new org user is switched to that org and redirect to org details view, Closes #2198
This commit is contained in:
parent
d3c6db1ba8
commit
3f917b0af5
@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/grafana/grafana/pkg/middleware"
|
"github.com/grafana/grafana/pkg/middleware"
|
||||||
m "github.com/grafana/grafana/pkg/models"
|
m "github.com/grafana/grafana/pkg/models"
|
||||||
"github.com/grafana/grafana/pkg/setting"
|
"github.com/grafana/grafana/pkg/setting"
|
||||||
|
"github.com/grafana/grafana/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GET /api/org
|
// GET /api/org
|
||||||
@ -50,7 +51,10 @@ func CreateOrg(c *middleware.Context, cmd m.CreateOrgCommand) Response {
|
|||||||
|
|
||||||
metrics.M_Api_Org_Create.Inc(1)
|
metrics.M_Api_Org_Create.Inc(1)
|
||||||
|
|
||||||
return ApiSuccess("Organization created")
|
return Json(200, &util.DynMap{
|
||||||
|
"orgId": cmd.Result.Id,
|
||||||
|
"message": "Organization created",
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT /api/org
|
// PUT /api/org
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'angular',
|
'angular',
|
||||||
|
'config',
|
||||||
],
|
],
|
||||||
function (angular) {
|
function (angular, config) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var module = angular.module('grafana.controllers');
|
var module = angular.module('grafana.controllers');
|
||||||
@ -11,7 +12,11 @@ function (angular) {
|
|||||||
$scope.newOrg = {name: ''};
|
$scope.newOrg = {name: ''};
|
||||||
|
|
||||||
$scope.createOrg = function() {
|
$scope.createOrg = function() {
|
||||||
backendSrv.post('/api/orgs/', $scope.newOrg).then($scope.getUserOrgs);
|
backendSrv.post('/api/orgs/', $scope.newOrg).then(function(result) {
|
||||||
|
backendSrv.post('/api/user/using/' + result.orgId).then(function() {
|
||||||
|
window.location.href = config.appSubUrl + '/org';
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user