From c630dce4cac2e669d554d6f67d76e9378c01e00c Mon Sep 17 00:00:00 2001 From: Safdar Jamal Date: Wed, 29 Jul 2020 18:50:36 +0500 Subject: [PATCH] Create data-validation library --- src/routes/entries/new.js | 2 +- src/validation/index.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 src/validation/index.js diff --git a/src/routes/entries/new.js b/src/routes/entries/new.js index 6de6540..a68534c 100644 --- a/src/routes/entries/new.js +++ b/src/routes/entries/new.js @@ -2,7 +2,7 @@ const express = require('express'); const router = express.Router(); const Entry = require('../../models/Entry'); -const validateEntry = require('../../validation/validateEntry'); +const { validateEntry } = require('../../validation'); router.get('/', (req, res) => res.render('pages/entries/new', { error: null })); diff --git a/src/validation/index.js b/src/validation/index.js new file mode 100644 index 0000000..72db7ea --- /dev/null +++ b/src/validation/index.js @@ -0,0 +1 @@ +module.exports.validateEntry = require('./validateEntry');