33 lines
770 B
JavaScript
33 lines
770 B
JavaScript
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
|
|
});
|
|
});
|