Skip to content

HW3 Tim Willis#21

Open
t1mwillis wants to merge 2 commits intopce-uw-jscript400:masterfrom
t1mwillis:master
Open

HW3 Tim Willis#21
t1mwillis wants to merge 2 commits intopce-uw-jscript400:masterfrom
t1mwillis:master

Conversation

@t1mwillis
Copy link

Adding my homework

@t1mwillis
Copy link
Author

I'd played around a little with schema values but I couldn't get a custom validator to work, I might ask you about this during "office hours"

router.put('/:id', async (req, res, next) => {
const status = 200
const book = await Books.findById(req.params.bookId)

Copy link

Choose a reason for hiding this comment

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

Remember to use a catch similar to your post so invalid formats etc will be reported in the response body.

dob: {
type: String,
validate: {
validator: function(v) {
Copy link

Choose a reason for hiding this comment

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

Nice including a validator.

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