flash/update で部分的に変更できるようにする (#13396)

* make flash/update params optional

* Update autogen files

pnpm run build-misskey-js-with-types

* Update update.ts

* Update CHANGELOG.md

* hasOwnProperty -> hasOwn

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
FineArchs 2024-02-22 21:31:57 +09:00 committed by GitHub
parent 4d6fab06de
commit bf5952fd63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 10 deletions

View File

@ -25,6 +25,7 @@
### Server ### Server
- Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正 - Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正
- エンドポイント`flash/update`の`flashId`以外のパラメータは必須ではなくなりました
- Fix: 禁止キーワードを含むートがDelayed Queueに追加されて再処理される問題を修正 - Fix: 禁止キーワードを含むートがDelayed Queueに追加されて再処理される問題を修正
## 2024.2.0 ## 2024.2.0

View File

@ -51,7 +51,7 @@ export const paramDef = {
} }, } },
visibility: { type: 'string', enum: ['public', 'private'] }, visibility: { type: 'string', enum: ['public', 'private'] },
}, },
required: ['flashId', 'title', 'summary', 'script', 'permissions'], required: ['flashId'],
} as const; } as const;
@Injectable() @Injectable()
@ -71,11 +71,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
await this.flashsRepository.update(flash.id, { await this.flashsRepository.update(flash.id, {
updatedAt: new Date(), updatedAt: new Date(),
title: ps.title, ...Object.fromEntries(
summary: ps.summary, Object.entries(ps).filter(
script: ps.script, ([key, val]) => (key !== 'flashId') && Object.hasOwn(paramDef.properties, key)
permissions: ps.permissions, )
visibility: ps.visibility, ),
}); });
}); });
} }

View File

@ -22927,10 +22927,10 @@ export type operations = {
'application/json': { 'application/json': {
/** Format: misskey:id */ /** Format: misskey:id */
flashId: string; flashId: string;
title: string; title?: string;
summary: string; summary?: string;
script: string; script?: string;
permissions: string[]; permissions?: string[];
/** @enum {string} */ /** @enum {string} */
visibility?: 'public' | 'private'; visibility?: 'public' | 'private';
}; };