fix: call remove if it's available

This commit is contained in:
P. Reis 2025-02-26 19:53:55 -03:00
parent ec3fa3daeb
commit c2769778f2

View file

@ -160,11 +160,13 @@ 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( if (relay.remove) {
(e: unknown) => { relay.remove([{ kinds: [30360], authors: [await conf.signer.getPublicKey()], '#p': [authorId] }]).catch(
logi({ level: 'error', ns: 'ditto.api.admin.account.action', type: data.type, error: errorJson(e) }); (e: unknown) => {
}, logi({ level: 'error', ns: 'ditto.api.admin.account.action', type: data.type, error: errorJson(e) });
); },
);
}
} }
await updateUser(authorId, n, c); await updateUser(authorId, n, c);