Skip to content

Commit

Permalink
flash/update で部分的に変更できるようにする (#13396)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: syuilo <[email protected]>
  • Loading branch information
FineArchs and syuilo authored Feb 22, 2024
1 parent 4d6fab0 commit bf5952f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

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

## 2024.2.0
Expand Down
12 changes: 6 additions & 6 deletions packages/backend/src/server/api/endpoints/flash/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const paramDef = {
} },
visibility: { type: 'string', enum: ['public', 'private'] },
},
required: ['flashId', 'title', 'summary', 'script', 'permissions'],
required: ['flashId'],
} as const;

@Injectable()
Expand All @@ -71,11 +71,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

await this.flashsRepository.update(flash.id, {
updatedAt: new Date(),
title: ps.title,
summary: ps.summary,
script: ps.script,
permissions: ps.permissions,
visibility: ps.visibility,
...Object.fromEntries(
Object.entries(ps).filter(
([key, val]) => (key !== 'flashId') && Object.hasOwn(paramDef.properties, key)
)
),
});
});
}
Expand Down
8 changes: 4 additions & 4 deletions packages/misskey-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22927,10 +22927,10 @@ export type operations = {
'application/json': {
/** Format: misskey:id */
flashId: string;
title: string;
summary: string;
script: string;
permissions: string[];
title?: string;
summary?: string;
script?: string;
permissions?: string[];
/** @enum {string} */
visibility?: 'public' | 'private';
};
Expand Down

0 comments on commit bf5952f

Please sign in to comment.