diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2025-01-14 20:30:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-14 11:30:49 +0000 |
| commit | da9e05582d1ce4c79a91b05abf73c18f2f2d5760 (patch) | |
| tree | 58fc934150cfdb233f87a4823b9986d0133ee397 /packages/backend/src/server | |
| parent | Enhance: GitHub Actionsでのffmpegインストールの失敗時リトライ... (diff) | |
| download | sharkey-da9e05582d1ce4c79a91b05abf73c18f2f2d5760.tar.gz sharkey-da9e05582d1ce4c79a91b05abf73c18f2f2d5760.tar.bz2 sharkey-da9e05582d1ce4c79a91b05abf73c18f2f2d5760.zip | |
fix(backend): `pages/update`のnameの重複チェックはnameプロパティがある時のみ行うように (#15104)
* fix(backend): pagesのnameの重複チェックはnameプロパティがある時のみ行うように
* Update Changelog
---------
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/server')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/pages/update.ts | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index f11bbbcb1a..e52d9c32df 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -102,15 +102,17 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- } } - await this.pagesRepository.findBy({ - id: Not(ps.pageId), - userId: me.id, - name: ps.name, - }).then(result => { - if (result.length > 0) { - throw new ApiError(meta.errors.nameAlreadyExists); - } - }); + if (ps.name != null) { + await this.pagesRepository.findBy({ + id: Not(ps.pageId), + userId: me.id, + name: ps.name, + }).then(result => { + if (result.length > 0) { + throw new ApiError(meta.errors.nameAlreadyExists); + } + }); + } await this.pagesRepository.update(page.id, { updatedAt: new Date(), |