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
c197421ac3
commit
b84145b604
1 changed files with 2 additions and 2 deletions
|
@ -12,12 +12,12 @@ const schema = new Schema<URL>({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
schema.path('urls').validate(async function(value) {
|
schema.path('url').validate(async function(value) {
|
||||||
const count = await models.URL.countDocuments({ url: value })
|
const count = await models.URL.countDocuments({ url: value })
|
||||||
|
|
||||||
return !count
|
return !count
|
||||||
}, 'URL already exists')
|
}, 'URL already exists')
|
||||||
|
|
||||||
const URLModel = model<URL>('urls', schema)
|
const URLModel = model<URL>('url', schema)
|
||||||
|
|
||||||
export = URLModel
|
export = URLModel
|
||||||
|
|
Loading…
Reference in a new issue