Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import define from "../../../define.js";
|
||||
import { Plans } from "../../../../../models/index.js";
|
||||
import { insertModerationLog } from "../../../../../services/insert-moderation-log.js";
|
||||
export const meta = {
|
||||
tags: [
|
||||
"admin"
|
||||
],
|
||||
requireCredential: true,
|
||||
requireAdmin: true
|
||||
};
|
||||
export const paramDef = {
|
||||
type: "object",
|
||||
properties: {
|
||||
planId: {
|
||||
type: "string",
|
||||
format: "misskey:id"
|
||||
}
|
||||
},
|
||||
required: [
|
||||
"planId"
|
||||
]
|
||||
};
|
||||
export default define(meta, paramDef, async (ps, me)=>{
|
||||
const plan = await Plans.findOneByOrFail({
|
||||
id: ps.planId
|
||||
});
|
||||
await Plans.delete(plan.id);
|
||||
insertModerationLog(me, "deletePlan", {
|
||||
planId: plan.id,
|
||||
name: plan.name
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user