Sequelize error who to insert data in database using Sequalize

Posted 10 months ago by asad98iftikhar

I am getting this error when i am trying to insert data base i have done all the migrations and my database is connected i am getting no error but when i am trying to submit data it giving me the error of FindOne()

/POST ADD page router.post('/add-page',function(req,res){

req.checkBody('title','Title must have a body.').notEmpty(); req.checkBody('content','Content must have a body.').notEmpty();

var title=req.body.title; var slug=req.body.slug.replace(/\s+/g, '-').toLowerCase(); if(slug==" ")slug=title.replace(/\s+/g, '-').toLowerCase();

var content=req.body.content;

var errors=req.validationErrors();

if(errors){ res.render('admin/add_page',{ errors:errors, title:title, slug:slug, content:content }); }

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.