This commit is contained in:
syuilo 2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View file

@ -11,13 +11,13 @@ export const meta = {
params: {
limit: {
validator: $.optional.num.range(1, 100),
default: 10
default: 10,
},
offset: {
validator: $.optional.num.min(0),
default: 0
}
default: 0,
},
},
res: {
@ -26,9 +26,9 @@ export const meta = {
items: {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'Note'
}
}
ref: 'Note',
},
},
};
export default define(meta, async (ps, user) => {
@ -68,10 +68,10 @@ export default define(meta, async (ps, user) => {
if (polls.length === 0) return [];
const notes = await Notes.find({
id: In(polls.map(poll => poll.noteId))
id: In(polls.map(poll => poll.noteId)),
});
return await Notes.packMany(notes, user, {
detail: true
detail: true,
});
});