Skip to content

Conversation

@Mikiyas-STP
Copy link

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

Changelist

this is two express app with one containing custom middleware and another containing builtin middleware

Questions

No question

@Mikiyas-STP Mikiyas-STP added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Decomposition The name of the module. labels Oct 16, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Looking good, though I have a suggestion of something to think about to help improve the reusability of the middleware youve written

return res.status(400).send("Request body must be a JSON array.");
}
// check every item is a string
const allStrings = parsed.every((item) => typeof item === "string");

Choose a reason for hiding this comment

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

here you're combining json parsing and checking the input as strings. as middleware aims to allow re-use of code, what change could you make to this that would allow you to re-use these separate checks more easily?

@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 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Decomposition The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants