Merge branch 'fix-ensure-remove-exists' into 'main'

fix: call remove if it's available

See merge request soapbox-pub/ditto!692
This commit is contained in:
P. Reis 2025-02-26 23:21:48 +00:00
commit 7f2e59e801

View file

@ -160,11 +160,12 @@ const adminActionController: AppController = async (c) => {
} }
if (data.type === 'revoke_name') { if (data.type === 'revoke_name') {
n.revoke_name = true; n.revoke_name = true;
relay.remove!([{ kinds: [30360], authors: [await conf.signer.getPublicKey()], '#p': [authorId] }]).catch( try {
(e: unknown) => { await relay.remove!([{ kinds: [30360], authors: [await conf.signer.getPublicKey()], '#p': [authorId] }]);
logi({ level: 'error', ns: 'ditto.api.admin.account.action', type: data.type, error: errorJson(e) }); } catch (e) {
}, logi({ level: 'error', ns: 'ditto.api.admin.account.action', type: data.type, error: errorJson(e) });
); return c.json({ error: 'Unexpected runtime error' }, 500);
}
} }
await updateUser(authorId, n, c); await updateUser(authorId, n, c);