DELETE http://localhost:4000/api/technology 404 (Not Found)

I have the following in technology.route.js :

router.delete('/', controller.deleteTech);
module.exports = router;

I have the following in technology.controller.js

const deleteTech = async(req, res, next) => {
    const id = req.params.id;
    try {
        const result = await technologyService.deleteTech(id);
        return res.json(result);
    } catch (err) {
        return next(err);
    }
};

module.exports = {
    deleteTech
};

And the following in technology.service.js :

const deleteTech = (id) => {
    return dbService.destroy(dbService.Technology, id);
};

module.exports = {
    deleteTech
};

And the following in db.service.js

const destroy = (Model, id) => {
    return new Model({ id }).destroy();
};

However when I try to make the request I get the error in the title for some reason:
await axios.delete(${TECHNOLOGY}, prevTech);

//prevTech is an object wich has id as one of its fields.`

Any ideas?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.