From 06b3e38f93d6c5b6e303e4afec036cd6d7c4c558 Mon Sep 17 00:00:00 2001 From: Oni-Men Date: Sun, 1 Sep 2019 10:18:50 +0900 Subject: [PATCH] update validator --- src/client/app/common/views/pages/page-editor/page-editor.vue | 3 --- src/server/api/endpoints/pages/create.ts | 2 +- src/server/api/endpoints/pages/update.ts | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/client/app/common/views/pages/page-editor/page-editor.vue b/src/client/app/common/views/pages/page-editor/page-editor.vue index 6b491cff95..207fc4e190 100644 --- a/src/client/app/common/views/pages/page-editor/page-editor.vue +++ b/src/client/app/common/views/pages/page-editor/page-editor.vue @@ -220,9 +220,6 @@ export default Vue.extend({ methods: { save() { - if (this.name.length == 0) { - this.name = this.currentName; - } const options = { title: this.title.trim(), diff --git a/src/server/api/endpoints/pages/create.ts b/src/server/api/endpoints/pages/create.ts index f18c82ffde..62077fa956 100644 --- a/src/server/api/endpoints/pages/create.ts +++ b/src/server/api/endpoints/pages/create.ts @@ -29,7 +29,7 @@ export const meta = { }, name: { - validator: $.str, + validator: $.str.min(1), }, summary: { diff --git a/src/server/api/endpoints/pages/update.ts b/src/server/api/endpoints/pages/update.ts index 564beb84cb..e98aedefa6 100644 --- a/src/server/api/endpoints/pages/update.ts +++ b/src/server/api/endpoints/pages/update.ts @@ -36,7 +36,7 @@ export const meta = { }, name: { - validator: $.optional.str, + validator: $.str.min(1), }, summary: {