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:
vakarisz 2022-07-28 13:24:41 +03:00
parent 6e821c5bbc
commit 6d146dae94
3 changed files with 2 additions and 15 deletions

View File

@ -30,7 +30,6 @@ class PropagationCredentials(AbstractResource):
def put(self, collection=None):
credentials = [Credentials.from_mapping(c) for c in request.json]
if collection == _configured_collection:
self._credentials_repository.remove_configured_credentials()
self._credentials_repository.save_configured_credentials(credentials)
@ -40,15 +39,3 @@ class PropagationCredentials(AbstractResource):
return {}, HTTPStatus.NOT_FOUND
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

View File

@ -252,7 +252,7 @@ class ConfigurePageComponent extends AuthComponent {
this.props.onStatusChange();
}
)
.then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'DELETE'})) ;
.then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'PUT', body: '[]'})) ;
};
sendPbaRemoveRequest(apiEndpoint) {

View File

@ -109,7 +109,7 @@ const IslandResetModal = (props: Props) => {
}})
.then(res => {
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 => {
if (res.status === 200) {