From 9288b5ad1fc955246cf2d9b6975f9fc2279791d3 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:21:50 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20pages=E3=81=AEname=E3=81=AE?= =?UTF-8?q?=E9=87=8D=E8=A4=87=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=AF?= =?UTF-8?q?name=E3=83=97=E3=83=AD=E3=83=91=E3=83=86=E3=82=A3=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=82=8B=E6=99=82=E3=81=AE=E3=81=BF=E8=A1=8C=E3=81=86?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/pages/update.ts | 20 ++++++++++--------- 1 file 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 { // 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(),