Expresso Title Property

I seem to always get a type error saying that the title property doesn’t exist every time that req.body.menu.title appears in my code on my menus.js file. Is there a new property other than req.body.menu or am I missing something else?

Here is my menu.js:

const express = require('express'); const menusRouter = express.Router({mergeParams: true}); const sqlite3 = require('sqlite3'); const db = new sqlite3.Database(process.env.TEST_DATABASE || './database.sqlite'); const menuItemsRouter = require('./menuItems'); menusRouter.param('menuId', (req, res, next, menuId) => { const sql = "SELECT * FROM Menu WHERE id = $menuId"; const values = {$menuId: menuId}; db.get(sql, values, (err, menu) => { if(err) { next(err); } else if(menu) { req.menu = menu; next(); } else { res.status(404).send() } }); }); menusRouter.use('/:menuId/menu-items', menusRouter); //GET Requests menusRouter.get('/', (req, res, next) => { db.all("SELECT * FROM Menu", (err, rows) => { if(err) { next(err); } else { res.status(200).json({menus: rows}); } }); }); menusRouter.get('/:menuId', (req, res, next) => { res.status(200).json({menu: req.menu}); }); //POST Requests menusRouter.post('/', (req, res, next) => { const title = req.body.menu.title; if(!title) { res.status(400).send(); } const sql = "INSERT INTO Menu (title) VALUES ($title)"; const values = {$title: title}; db.run(sql, values, function(err) { if(err) { next(err); } else { db.get(`SELECT * FROM Menu WHERE id = ${this.lastID}`, (err, rows) => { if(err) { next(err); } else { res.status(201).json({menu: rows}); } }); } }); }); //PUT Requests menusRouter.put('/:menuId', (req, res, next) => { const title = req.body.menu.title; if(!title) { res.status(400).send(); } const sql = "UPDATE Menu SET title = $title WHERE id = $menuId"; const values = { $title: title, $menuId: req.params.menuId }; db.run(sql, values, (err) => { if(err) { next(err); } else { db.get(`SELECT * FROM Menu WHERE id = ${req.params.menuId}`, (err, menu) => { if(err) { next(err); } else { res.status(200).json({menu: menu}); } }); } }); }); //DELETE Requests menusRouter.delete('/:menuId', (req, res, next) => { db.get(`SELECT * FROM MenuItem WHERE menu_id = ${req.params.menuId}`, (err, menuItem) => { if(err) { next(err); } else if(menuItem) { res.status(400).send(); } else { db.run("DELETE FROM Menu WHERE id = $menuId", {$menuId: req.params.menuId}, (err) => { if(err) { next(err); } else { res.status(204).send(); } }); } }); }); module.exports = menusRouter;