Add revoke_name admin action
This commit is contained in:
parent
229975a752
commit
d1ba797c93
|
@ -109,7 +109,7 @@ const adminAccountsController: AppController = async (c) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const adminAccountActionSchema = z.object({
|
const adminAccountActionSchema = z.object({
|
||||||
type: z.enum(['none', 'sensitive', 'disable', 'silence', 'suspend']),
|
type: z.enum(['none', 'sensitive', 'disable', 'silence', 'suspend', 'revoke_name']),
|
||||||
});
|
});
|
||||||
|
|
||||||
const adminActionController: AppController = async (c) => {
|
const adminActionController: AppController = async (c) => {
|
||||||
|
@ -139,6 +139,10 @@ const adminActionController: AppController = async (c) => {
|
||||||
n.suspended = true;
|
n.suspended = true;
|
||||||
store.remove([{ authors: [authorId] }]).catch(console.warn);
|
store.remove([{ authors: [authorId] }]).catch(console.warn);
|
||||||
}
|
}
|
||||||
|
if (data.type === 'revoke_name') {
|
||||||
|
n.revoke_name = true;
|
||||||
|
store.remove([{ kinds: [30360], authors: [Conf.pubkey], '#p': [authorId] }]).catch(console.warn);
|
||||||
|
}
|
||||||
|
|
||||||
await updateUser(authorId, n, c);
|
await updateUser(authorId, n, c);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue