Cumulative Project: Boss Machine

link to project

Ok so when I run the root file I keep getting this error:

        throw new Error(msg);

Error: requires a callback function but got a [object String]
    at Route.<computed> [as post] (/Users/jasonhunter/Documents/Codecademy/project-4-boss-machine-start/node_modules/express/lib/router/route.js:202:15)
    at Function.proto.<computed> [as post] (/Users/jasonhunter/Documents/Codecademy/project-4-boss-machine-start/node_modules/express/lib/router/index.js:510:19)
    at Object.<anonymous> (/Users/jasonhunter/Documents/Codecademy/project-4-boss-machine-start/server/ideas.js:24:13)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/jasonhunter/Documents/Codecademy/project-4-boss-machine-start/server/api.js:5:21)

I spent a couple hours meddling with my code (different from solution) without any success so I ended up copying the solution code line for line and I still get the same error. It’s referring to the checkMillionDollarIdea middleware in my post route. (Code Below) When I remove the middleware from route it works fine.

Here is the checkMillionDollarIdea middleware code:

const checkMillionDollarIdea = (req, res, next) => {
  const { numWeeks, weeklyRevenue } = req.body;
  const totalMoney = Number(numWeeks) * Number(weeklyRevenue);
  if (!numWeeks || !weeklyRevenue || isNaN(totalMoney) || totalMoney < 1000000) {
  } else {

Here is the ideas POST route that is catching the error:'/', checkMillionDollarIdea, (req, res, next) => {
  const newIdea = addToDatabase('ideas', req.body);

Any help would be appreciated!