CSCI-GA-2820-FA24-003 / recommendations

NYU DevOps Recommendations Service Fall 2024
Apache License 2.0
0 stars 1 forks source link

fixed deserialization errors #52

Closed muyunli123 closed 1 week ago

muyunli123 commented 1 week ago

deleted like and dislike from deserialize() to fix data validation error

agustdmybae commented 1 week ago

I wonder why adding like and dislike to deserialize() will cause errors?

muyunli123 commented 1 week ago

I wonder why adding like and dislike to deserialize() will cause errors?

Because deserialize() is used in create() and update() where the input information will be parsed. But like and dislike are set to 0 when created and added 1 each time Like and Dislike is called. So it is not an information given by the users, but more like the attributes created_at and updated_at.

agustdmybae commented 1 week ago

I wonder why adding like and dislike to deserialize() will cause errors?

Because deserialize() is used in create() and update() where the input information will be parsed. But like and dislike are set to 0 when created and added 1 each time Like and Dislike is called. So it is not an information given by the users, but more like the attributes created_at and updated_at.

Got it! Thanks for the explanation.