feat: お知らせの優先順位機能 (#118)

ついでにお知らせのページング処理、わかったのボタン押したとき更新されるように
This commit is contained in:
まっちゃとーにゅ 2023-07-28 00:29:33 +09:00 committed by GitHub
parent 5b4948768a
commit fe0f7a91a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 126 additions and 69 deletions

View file

@ -26,6 +26,7 @@ export const paramDef = {
title: { type: 'string', minLength: 1 },
text: { type: 'string', minLength: 1 },
imageUrl: { type: 'string', nullable: true, minLength: 0 },
displayOrder: { type: 'number' },
userId: { type: 'string', nullable: true, format: 'misskey:id' },
closeDuration: { type: 'number', nullable: false },
},
@ -57,6 +58,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
text: ps.text,
/* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- 空の文字列の場合、nullを渡すようにするため */
imageUrl: ps.imageUrl || null,
displayOrder: ps.displayOrder,
userId: ps.userId ?? null,
closeDuration: ps.closeDuration,
});