1.17K viewsMern Amazona

Getting this error:

Order validation failed: user: Path `user` is required

Bassir Edited question October 11, 2022

Answer:

it says you didn’t set user in order model here:

https://github.com/basir/mern-amazona/blob/master/backend/routes/orderRoutes.js#L32

use

console.log(req.user)

to see what you pass to db and fix the issue there.

Bassir Answered question October 11, 2022