mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
check if model exist
This commit is contained in:
parent
95753adbaa
commit
47b7c51689
@ -10,7 +10,7 @@ function generateModels() {
|
||||
dirs.forEach((file) => {
|
||||
const model = require(path.join(__dirname, file)).default
|
||||
|
||||
if (mongoose.model[model.name]) {
|
||||
if (mongoose.models[model.name]) {
|
||||
return models[model.name] = mongoose.model(model.name)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user