mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -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;
|
||||
}
|
||||
|
||||
backendSrv.put('/api/user/signup', $scope.formModel).then(function() {
|
||||
backendSrv.post('/api/user/signup', $scope.formModel).then(function() {
|
||||
window.location.href = config.appSubUrl + '/';
|
||||
});
|
||||
};
|
||||
|
@ -24,22 +24,12 @@ function (angular) {
|
||||
};
|
||||
|
||||
$scope.removeUser = function(user) {
|
||||
backendSrv.request({
|
||||
method: 'DELETE',
|
||||
url: '/api/account/users/' + user.userId
|
||||
}).then($scope.get);
|
||||
backendSrv.delete('/api/account/users/' + user.userId).then($scope.get);
|
||||
};
|
||||
|
||||
$scope.addUser = function() {
|
||||
if (!$scope.form.$valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
backendSrv.request({
|
||||
method: 'PUT',
|
||||
url: '/api/account/users',
|
||||
data: $scope.user,
|
||||
}).then($scope.get);
|
||||
if (!$scope.form.$valid) { return; }
|
||||
backendSrv.post('/api/account/users', $scope.user).then($scope.get);
|
||||
};
|
||||
|
||||
$scope.init();
|
||||
|
@ -26,12 +26,7 @@ function (angular) {
|
||||
};
|
||||
|
||||
$scope.addToken = function() {
|
||||
backendSrv.request({
|
||||
method: 'PUT',
|
||||
url: '/api/tokens',
|
||||
data: $scope.token,
|
||||
desc: 'Add token'
|
||||
}).then($scope.getTokens);
|
||||
backendSrv.post('/api/tokens', $scope.token).then($scope.getTokens);
|
||||
};
|
||||
|
||||
$scope.init();
|
||||
|
@ -33,12 +33,11 @@ function (angular) {
|
||||
|
||||
$scope.update = function() {
|
||||
if (!$scope.userForm.$valid) { return; }
|
||||
|
||||
backendSrv.post('/api/user/', $scope.user);
|
||||
backendSrv.put('/api/user/', $scope.user);
|
||||
};
|
||||
|
||||
$scope.createAccount = function() {
|
||||
backendSrv.put('/api/account/', $scope.newAccount).then($scope.getUserAccounts);
|
||||
backendSrv.post('/api/account/', $scope.newAccount).then($scope.getUserAccounts);
|
||||
};
|
||||
|
||||
$scope.init();
|
||||
|
Loading…
Reference in New Issue
Block a user