Skip to content

NW| 26-Jul-SDC | Ahmad Hmedan | Sprint 3 | Middleware exercises - #119

Open
AhmadHmedann wants to merge 2 commits into
CodeYourFuture:mainfrom
AhmadHmedann:middlewares
Open

AhmadHmedann wants to merge 2 commits into
CodeYourFuture:mainfrom
AhmadHmedann:middlewares

Conversation

@AhmadHmedann

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1165

Changelist

@AhmadHmedann AhmadHmedann added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 7, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good work,I have just one minor suggested fix.

Apologies for the delay in review

app.use(express.json());

app.post("/", (req, res) => {
if (!Array.isArray(req.body)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The built-in express middleware for JSON doesn't handle the part you needed about checking if it was an array. Could this array checking part also be a middleware?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants