Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { Users } from "../../../../models/index.js";
|
||||
import { deleteAccount } from "../../../../services/delete-account.js";
|
||||
import define from "../../define.js";
|
||||
export const meta = {
|
||||
tags: [
|
||||
"admin"
|
||||
],
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
res: {}
|
||||
};
|
||||
export const paramDef = {
|
||||
type: "object",
|
||||
properties: {
|
||||
userId: {
|
||||
type: "string",
|
||||
format: "misskey:id"
|
||||
}
|
||||
},
|
||||
required: [
|
||||
"userId"
|
||||
]
|
||||
};
|
||||
export default define(meta, paramDef, async (ps)=>{
|
||||
const user = await Users.findOneByOrFail({
|
||||
id: ps.userId
|
||||
});
|
||||
if (user.isDeleted) {
|
||||
return;
|
||||
}
|
||||
await deleteAccount(user);
|
||||
});
|
||||
Reference in New Issue
Block a user