From b84145b604b5f511689f94eb54aa69b02a3023e6 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 15 Sep 2021 22:26:37 +0200 Subject: [PATCH] Update schema.ts --- lib/schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/schema.ts b/lib/schema.ts index 731dab6..8596218 100644 --- a/lib/schema.ts +++ b/lib/schema.ts @@ -12,12 +12,12 @@ const schema = new Schema({ } }) -schema.path('urls').validate(async function(value) { +schema.path('url').validate(async function(value) { const count = await models.URL.countDocuments({ url: value }) return !count }, 'URL already exists') -const URLModel = model('urls', schema) +const URLModel = model('url', schema) export = URLModel