Closed DG-98 closed 2 years ago
try console logging req.body to see if anything's hitting the server
this is what's returned
and nothing shows up in your database?
This is what the entries look like
It seems like since the req.body is already an object you're taking some extra steps?
I cut back on some stuff so it posts like this: but it still shows up in the DB like the other pic I sent
what's your schema look like?
const listSchema = new mongoose.Schema(
{
animeId: {
type: Number,
require: true,
},
title: {
type: String,
require: true,
}
}
)
const List = mongoose.model("List", listSchema)
module.exports = List
So i think that's your issue. AnimeID and title are nested inside of "List", and aren't getting assigned to their respective keys in the schema
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
MERN
What's the problem you're trying to solve?
When using a post route in postman, the db entry ends up being empty for some reason
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
no error message just posts with no body
What is your best guess as to the source of the problem?
Honestly not sure, I've tried checking spelling and syntax but it made no difference
What things have you already tried to solve the problem?