Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pubsweet
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giorgio Sironi
pubsweet
Commits
4430983e
Commit
4430983e
authored
7 years ago
by
Jure
Browse files
Options
Downloads
Patches
Plain Diff
Safely fall back if config.validations is not provided
parent
f737be84
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/server/src/models/Model.js
+7
-2
7 additions, 2 deletions
packages/server/src/models/Model.js
with
7 additions
and
2 deletions
packages/server/src/models/Model.js
+
7
−
2
View file @
4430983e
...
...
@@ -9,8 +9,13 @@ const logger = require('@pubsweet/logger')
const
config
=
require
(
'
config
'
)
const
appValidations
=
require
(
config
.
validations
)
const
validations
=
require
(
'
./validations
'
)(
appValidations
)
let
validations
if
(
config
.
validations
)
{
const
appValidations
=
require
(
config
.
validations
)
validations
=
require
(
'
./validations
'
)(
appValidations
)
}
else
{
validations
=
require
(
'
./validations
'
)()
}
schema
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment