From b5364a8ab409b1c38af1ea8823b37884719ce8a1 Mon Sep 17 00:00:00 2001 From: f0x Date: Thu, 1 Dec 2022 20:20:51 +0000 Subject: [PATCH] implement editing domain blocks by delete + recreate --- web/source/settings/lib/api/admin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/source/settings/lib/api/admin.js b/web/source/settings/lib/api/admin.js index 7df3093fd..3dba699ff 100644 --- a/web/source/settings/lib/api/admin.js +++ b/web/source/settings/lib/api/admin.js @@ -59,8 +59,10 @@ module.exports = function ({ apiCall, getChanges }) { updateDomainBlock: function updateDomainBlock(domain) { return function (dispatch, getState) { + const state = getState().admin.newInstanceBlocks[domain]; return Promise.try(() => { - const state = getState().admin.newInstanceBlocks[domain]; + return dispatch(apiCall("DELETE", `/api/v1/admin/domain_blocks/${state.id}`)); + }).then(() => { const update = getChanges(state, { formKeys: ["domain", "obfuscate", "public_comment", "private_comment"], });