Express.js, Boss Machine Project: Can't pass the delete workId in the bonus section

Hello everyone,

I’m currently working on the Boss Machine Project. Here is a link to the project: https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-build-a-back-end-with-node-express-js/modules/fscp-api-project-boss-machine/informationals/bapi-p4-boss-machine

I am working on the bonus section where you have to delete the work input based on the workId parameter. For some reason I can’t pass the test even though on the client side I can successfully delete a work entry in the profiles of the minions. Here is my minions.js code where I have my delete route:

const express = require('express');
const minionsRouter = express.Router();
const bodyParser = require('body-parser')
const {
    createMeeting,
    getAllFromDatabase,
    getFromDatabaseById,
    addToDatabase,
    updateInstanceInDatabase,
    deleteFromDatabasebyId,
    deleteAllFromDatabase,
  } = require('./db');

  minionsRouter.use(bodyParser.json());

minionsRouter.delete('/:minionId/work/:workId', (req, res, next) => {
  const deletedWorkId = req.params.workId;
  const deleted = deleteFromDatabasebyId('work', deletedWorkId);
  console.log(deleted);
  if (deleted) {
    res.status(204);
  } else {
    res.status(500);
  }
  res.send();
});

And here are the test results for my delete route:

I’m not sure what I am doing wrong. Any ideas? Any help is appreciated. Thanks everyone and happy coding :slight_smile:

I’m on my phone, so I can’t check code atm, but im guessing the deleteFromDatabaseById function is not generic enough to just apply it with a workId instead of a minionId. You may need to write a query from scratch