mirror of
https://github.com/MedzikUser/gatsby-pingbot
synced 2024-08-15 03:20:27 +00:00
Update schema.ts
This commit is contained in:
parent
2e828b688d
commit
c197421ac3
1 changed files with 2 additions and 2 deletions
|
@ -12,12 +12,12 @@ const schema = new Schema<URL>({
|
|||
}
|
||||
})
|
||||
|
||||
schema.path('url').validate(async function(value) {
|
||||
schema.path('urls').validate(async function(value) {
|
||||
const count = await models.URL.countDocuments({ url: value })
|
||||
|
||||
return !count
|
||||
}, 'URL already exists')
|
||||
|
||||
const URLModel = model<URL>('URL', schema)
|
||||
const URLModel = model<URL>('urls', schema)
|
||||
|
||||
export = URLModel
|
||||
|
|
Loading…
Reference in a new issue