Skip to content

Conversation

@Sabella-8
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarCloud

@Sabella-8
Copy link
Author

Copy link

@Ara225 Ara225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No major complaints, well done

const data = require("./mailing-lists");
const app = express();
app.use(express.json());
const lists = new Map(Object.entries(data));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particluar reason you wanted to copy the data into a diffrent object?

if (listsArray.length > 0) {
res.status(200).send(listsArray);
} else {
res.status(200).send({});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct I'm afraid - the readme asked for an empty array not an empty object

} else {
res.status(404).send("list not found");
}
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

const updatedList = Array.from(lists.keys());
res.status(200).send(updatedList);
} else {
res.status(404).send("list not found");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work - apprecate the good error checking you have here :)

const updatedList = Array.from(lists.keys());
res.status(201).send(updatedList);
}
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants