refactor: use ?.

This commit is contained in:
P. Reis 2025-02-26 20:06:57 -03:00
parent c2769778f2
commit 71946de478

View file

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