diff options
| author | yupix <yupi0982@outlook.jp> | 2024-06-22 14:52:27 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-22 14:52:27 +0900 |
| commit | b50eb511b0cf6fb05d37c3370726f940c1438a99 (patch) | |
| tree | 52e14d01a8a52799da0cf7796caab1c244f04a6b /packages/backend/src/server/api/endpoints/i/webhooks | |
| parent | fix(backend): フィードのノートのMFMはHTMLにレンダーしてか... (diff) | |
| download | misskey-b50eb511b0cf6fb05d37c3370726f940c1438a99.tar.gz misskey-b50eb511b0cf6fb05d37c3370726f940c1438a99.tar.bz2 misskey-b50eb511b0cf6fb05d37c3370726f940c1438a99.zip | |
refactor: api/*/update系の必須キーを最低限に (#13824)
* refactor: clips/updateの必須キーをclipIdのみに
* refactor: admin/roles/update の必須キーをroleIdのみに
* feat: pages/update の必須キーをpageIdのみに
* refactor: gallery/posts/update の必須キーをpostidのみに
* feat: misskey-jsの型を更新
* feat: i/webhooks/updateの必須キーをwebhookIdのみに
* feat: admin/ad/updateの必須キーをidのみに
* feat: misskey-jsの型を更新
* chore: update CHANGELOG.md
* docs: update CHANGELOG.md
* fix: secretが更新できなくなる場合がある
Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
* Update packages/backend/src/server/api/endpoints/gallery/posts/update.ts
---------
Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/server/api/endpoints/i/webhooks')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/i/webhooks/update.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts index 6e380d76f8..07a25bd82a 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts @@ -34,13 +34,13 @@ export const paramDef = { webhookId: { type: 'string', format: 'misskey:id' }, name: { type: 'string', minLength: 1, maxLength: 100 }, url: { type: 'string', minLength: 1, maxLength: 1024 }, - secret: { type: 'string', maxLength: 1024, default: '' }, + secret: { type: 'string', nullable: true, maxLength: 1024 }, on: { type: 'array', items: { type: 'string', enum: webhookEventTypes, } }, active: { type: 'boolean' }, }, - required: ['webhookId', 'name', 'url', 'on', 'active'], + required: ['webhookId'], } as const; // TODO: ロジックをサービスに切り出す @@ -66,7 +66,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- await this.webhooksRepository.update(webhook.id, { name: ps.name, url: ps.url, - secret: ps.secret, + secret: ps.secret === null ? '' : ps.secret, on: ps.on, active: ps.active, }); |