Back End Development and APIs Projects - Exercise Tracker

Hello I’ve everyone, I’m having some trouble passing the 7th test of the Exercise tracker project. My response seems correct to me and I’ve tried every solution on every similar issue posted I could find; still doesn’t work.
Your help will be appreciated.

The test : You can POST to /api/users/:_id/exercises with form data description , duration , and optionally date . If no date is supplied, the current date will be used."/api/users/:_id/exercises", async (req, res) => {
  try {
    if (!req.body.description || !req.body.duration) {
      throw new Error("Error");
    if (!req.params._id) {
      return res.json({
        error: "ID not found",

    let user = await User.findOne({ _id: req.params._id });
    if (!user) {
      return res.json({
        error: "ID not found",
    let log = new Log({
      description: req.body.description,
      duration: Number(req.body.duration),
      date: === "" || !
          ? new Date()
          : new Date(,
      user: user._id,

    return res.json({
      _id: user._id,
      username: user.username,
      date: !
        ? moment().format("ddd MMM DD YYYY")
        : moment("ddd MMM DD YYYY"),
      duration: Number(log.duration),
      description: log.description,
  } catch (e) {
    return res.json({ error: e.message });

Your project link(s)


githubLink: GitHub - espiramos/exercise-tracker-freecodecamp

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

The test is broken. It has been fixed but is not in production yet.

Oh thanks. Any info on when it will be in production?


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