mirror of
1
Fork 0

implement editing domain blocks by delete + recreate

This commit is contained in:
f0x 2022-12-01 20:20:51 +00:00
parent 558b448ab2
commit b5364a8ab4
1 changed files with 3 additions and 1 deletions

View File

@ -59,8 +59,10 @@ module.exports = function ({ apiCall, getChanges }) {
updateDomainBlock: function updateDomainBlock(domain) {
return function (dispatch, getState) {
return Promise.try(() => {
const state = getState().admin.newInstanceBlocks[domain];
return Promise.try(() => {
return dispatch(apiCall("DELETE", `/api/v1/admin/domain_blocks/${state.id}`));
}).then(() => {
const update = getChanges(state, {
formKeys: ["domain", "obfuscate", "public_comment", "private_comment"],
});