Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,50 @@
import define from "../../define.js";
import { genId } from "../../../../misc/gen-id.js";
import { Clips } from "../../../../models/index.js";
export const meta = {
tags: [
"clips"
],
requireCredential: true,
kind: "write:account",
res: {
type: "object",
optional: false,
nullable: false,
ref: "Clip"
}
};
export const paramDef = {
type: "object",
properties: {
name: {
type: "string",
minLength: 1,
maxLength: 100
},
isPublic: {
type: "boolean",
default: false
},
description: {
type: "string",
nullable: true,
minLength: 1,
maxLength: 2048
}
},
required: [
"name"
]
};
export default define(meta, paramDef, async (ps, user)=>{
const clip = await Clips.insert({
id: genId(),
createdAt: new Date(),
userId: user.id,
name: ps.name,
isPublic: ps.isPublic,
description: ps.description
}).then((x)=>Clips.findOneByOrFail(x.identifiers[0]));
return await Clips.pack(clip);
});