Closed isaac8069 closed 2 years ago
The tags have an id too right? So apartmentId is coming from the url bc it's based on user input. The tag id would be used to include the tag in the apartment info when the page renders*
I understand the tagId being used to choose which tag, but I am not following on if that is something I need to add to this code or if you are just explaining the logic of the code. Also, the error message: "type": "entity.parse.failed". Is this saying it failed to pass a different type to another type?
What do you mean when you say "which tag"? Like if you're trying to access a specific tag from the apartment's array? (Also, would you mind posting a screenshot of the entire type error)
Apartments: Apt1, Apt2, Apt3 Apt1Id = 123 Apt2Id = 345 Apt3Id = 567 Tags: apple, orange, lemon Association Apt1Id = lemon Apt2Id = lemon, apple Apt3Id = orange Based on the code block I don't see where tagId is coming into play. So how can I determine the tag I want to associate to an apt? Hopefully that will help with the question I am asking.
It looks like it's using req.body.tag
-- so there's a form where a tag is being entered/created?
Resolved
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
MERN
What's the problem you're trying to solve?
Patch route to add tag to apartment. Both tag and apartment have already been created. I find the apartmentId, then I push a tag into an apartment:tagRef array. I also don't understand how you choose which tag? I understand the apartment is found using apartmentId but I don't understand based on my code how I choose which tag.
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?
"type": "entity.parse.failed"
What is your best guess as to the source of the problem?
I'm not sure i add NPM Body-Parser and tried to see if that would help
What things have you already tried to solve the problem?