mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
Corrected the use of POST vs PUT, POST creates something, PUT updates, got them mixed up
This commit is contained in:
parent
71ab8d6afc
commit
ab7e2f89fb
@ -75,7 +75,7 @@ function (angular, config) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
backendSrv.put('/api/user/signup', $scope.formModel).then(function() {
|
backendSrv.post('/api/user/signup', $scope.formModel).then(function() {
|
||||||
window.location.href = config.appSubUrl + '/';
|
window.location.href = config.appSubUrl + '/';
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -24,22 +24,12 @@ function (angular) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.removeUser = function(user) {
|
$scope.removeUser = function(user) {
|
||||||
backendSrv.request({
|
backendSrv.delete('/api/account/users/' + user.userId).then($scope.get);
|
||||||
method: 'DELETE',
|
|
||||||
url: '/api/account/users/' + user.userId
|
|
||||||
}).then($scope.get);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.addUser = function() {
|
$scope.addUser = function() {
|
||||||
if (!$scope.form.$valid) {
|
if (!$scope.form.$valid) { return; }
|
||||||
return;
|
backendSrv.post('/api/account/users', $scope.user).then($scope.get);
|
||||||
}
|
|
||||||
|
|
||||||
backendSrv.request({
|
|
||||||
method: 'PUT',
|
|
||||||
url: '/api/account/users',
|
|
||||||
data: $scope.user,
|
|
||||||
}).then($scope.get);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init();
|
$scope.init();
|
||||||
|
@ -26,12 +26,7 @@ function (angular) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.addToken = function() {
|
$scope.addToken = function() {
|
||||||
backendSrv.request({
|
backendSrv.post('/api/tokens', $scope.token).then($scope.getTokens);
|
||||||
method: 'PUT',
|
|
||||||
url: '/api/tokens',
|
|
||||||
data: $scope.token,
|
|
||||||
desc: 'Add token'
|
|
||||||
}).then($scope.getTokens);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init();
|
$scope.init();
|
||||||
|
@ -33,12 +33,11 @@ function (angular) {
|
|||||||
|
|
||||||
$scope.update = function() {
|
$scope.update = function() {
|
||||||
if (!$scope.userForm.$valid) { return; }
|
if (!$scope.userForm.$valid) { return; }
|
||||||
|
backendSrv.put('/api/user/', $scope.user);
|
||||||
backendSrv.post('/api/user/', $scope.user);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.createAccount = function() {
|
$scope.createAccount = function() {
|
||||||
backendSrv.put('/api/account/', $scope.newAccount).then($scope.getUserAccounts);
|
backendSrv.post('/api/account/', $scope.newAccount).then($scope.getUserAccounts);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init();
|
$scope.init();
|
||||||
|
Loading…
Reference in New Issue
Block a user