Merge pull request #2084 from guardicore/1965-delete-configured-creds-on-config-reset
Use DELETE /api/propagation-credentials/configured-credentials
This commit is contained in:
commit
2940cc51e8
|
@ -21,6 +21,7 @@ import {reformatConfig} from '../configuration-components/ReformatHook';
|
|||
|
||||
const CONFIG_URL = '/api/agent-configuration';
|
||||
const RESET_URL = '/api/reset-agent-configuration';
|
||||
const CONFIGURED_PROPAGATION_CREDENTIALS_URL = '/api/propagation-credentials/configured-credentials';
|
||||
export const API_PBA_LINUX = '/api/file-upload/PBAlinux';
|
||||
export const API_PBA_WINDOWS = '/api/file-upload/PBAwindows';
|
||||
|
||||
|
@ -233,10 +234,12 @@ class ConfigurePageComponent extends AuthComponent {
|
|||
this.updateConfig();
|
||||
this.props.onStatusChange();
|
||||
}
|
||||
).then(() => {
|
||||
this.removePBAfile(API_PBA_WINDOWS, this.setPbaFilenameWindows)
|
||||
this.removePBAfile(API_PBA_LINUX, this.setPbaFilenameLinux)
|
||||
});
|
||||
)
|
||||
.then(() => {
|
||||
this.removePBAfile(API_PBA_WINDOWS, this.setPbaFilenameWindows)
|
||||
this.removePBAfile(API_PBA_LINUX, this.setPbaFilenameLinux)
|
||||
})
|
||||
.then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'DELETE'}));
|
||||
};
|
||||
|
||||
removePBAfile(apiEndpoint, setFilenameFnc) {
|
||||
|
|
|
@ -107,6 +107,10 @@ const IslandResetModal = (props: Props) => {
|
|||
if (res.status === 200) {
|
||||
return auth.authFetch('/api/clear-simulation-data', {method: 'POST'})
|
||||
}})
|
||||
.then(res => {
|
||||
if (res.status === 200) {
|
||||
return auth.authFetch('/api/propagation-credentials/configured-credentials', {method: 'DELETE'})
|
||||
}})
|
||||
.then(res => {
|
||||
if (res.status === 200) {
|
||||
return auth.authFetch('/api/island-mode', {method: 'POST', body: '{"mode": "unset"}'})
|
||||
|
|
Loading…
Reference in New Issue