Fixed "delete all content" modal not closing in AdminX (#18620)

refs https://github.com/TryGhost/Product/issues/3831

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
This commit is contained in:
Jono M 2023-10-13 18:50:44 +01:00 committed by GitHub
parent 1a83fedfa4
commit 31b3905f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,13 +64,14 @@ const MigrationOptions: React.FC = () => {
prompt: 'This is permanent! No backups, no restores, no magic undo button. We warned you, k?',
okColor: 'red',
okLabel: 'Delete',
onOk: async () => {
onOk: async (modal) => {
try {
await deleteAllContent(null);
showToast({
type: 'success',
message: 'All content deleted from database.'
});
modal?.remove();
await client.refetchQueries();
} catch (e) {
handleError(e);