forked from p15670423/monkey
Island, UI: Remove delete method from propagation credentials
Instead of delete, put should be used with an empty list of credentials
This commit is contained in:
parent
6e821c5bbc
commit
6d146dae94
|
@ -30,7 +30,6 @@ class PropagationCredentials(AbstractResource):
|
||||||
|
|
||||||
def put(self, collection=None):
|
def put(self, collection=None):
|
||||||
credentials = [Credentials.from_mapping(c) for c in request.json]
|
credentials = [Credentials.from_mapping(c) for c in request.json]
|
||||||
|
|
||||||
if collection == _configured_collection:
|
if collection == _configured_collection:
|
||||||
self._credentials_repository.remove_configured_credentials()
|
self._credentials_repository.remove_configured_credentials()
|
||||||
self._credentials_repository.save_configured_credentials(credentials)
|
self._credentials_repository.save_configured_credentials(credentials)
|
||||||
|
@ -40,15 +39,3 @@ class PropagationCredentials(AbstractResource):
|
||||||
return {}, HTTPStatus.NOT_FOUND
|
return {}, HTTPStatus.NOT_FOUND
|
||||||
|
|
||||||
return {}, HTTPStatus.NO_CONTENT
|
return {}, HTTPStatus.NO_CONTENT
|
||||||
|
|
||||||
def delete(self, collection=None):
|
|
||||||
if collection == _configured_collection:
|
|
||||||
self._credentials_repository.remove_configured_credentials()
|
|
||||||
elif collection == _stolen_collection:
|
|
||||||
self._credentials_repository.remove_stolen_credentials()
|
|
||||||
elif collection is None:
|
|
||||||
self._credentials_repository.remove_all_credentials()
|
|
||||||
else:
|
|
||||||
return {}, HTTPStatus.NOT_FOUND
|
|
||||||
|
|
||||||
return {}, HTTPStatus.NO_CONTENT
|
|
||||||
|
|
|
@ -252,7 +252,7 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
this.props.onStatusChange();
|
this.props.onStatusChange();
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'DELETE'})) ;
|
.then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'PUT', body: '[]'})) ;
|
||||||
};
|
};
|
||||||
|
|
||||||
sendPbaRemoveRequest(apiEndpoint) {
|
sendPbaRemoveRequest(apiEndpoint) {
|
||||||
|
|
|
@ -109,7 +109,7 @@ const IslandResetModal = (props: Props) => {
|
||||||
}})
|
}})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
return auth.authFetch('/api/propagation-credentials/configured-credentials', {method: 'DELETE'})
|
return auth.authFetch('/api/propagation-credentials/configured-credentials', {method: 'PUT', body:'[]'})
|
||||||
}})
|
}})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
|
Loading…
Reference in New Issue