Improve domain unblock compatibility, fixes #422

This commit is contained in:
Alex Gleason 2020-07-16 13:39:59 -05:00
parent 2024c4ec0d
commit 03e33df86b
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -61,7 +61,13 @@ export function unblockDomain(domain) {
dispatch(unblockDomainRequest(domain));
api(getState).delete('/api/v1/domain_blocks', { params: { domain } }).then(() => {
// Do it both ways for maximum compatibility
const params = {
params: { domain },
data: { domain },
};
api(getState).delete('/api/v1/domain_blocks', params).then(() => {
const at_domain = '@' + domain;
const accounts = getState().get('accounts').filter(item => item.get('acct').endsWith(at_domain)).valueSeq().map(item => item.get('id'));
dispatch(unblockDomainSuccess(domain, accounts));