-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix default_type_id type in animal uses API #3391
Conversation
* make the test more strict
ff616b6
to
eb84cb6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! And it's kind of fun to see a situation in the wild where ==
vs ===
makes the difference!
I guess a +1 to TS on the backend too 🙂
@@ -57,7 +57,7 @@ class AnimalUse extends baseModel { | |||
}, {}); | |||
|
|||
const response = Object.entries(usesPerType).map(([defaultTypeId, uses]) => { | |||
return { default_type_id: defaultTypeId, uses }; | |||
return { default_type_id: +defaultTypeId, uses }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does fix the typing, but I am not sure about all the manipulation to format the data before it gets to the frontend that seems to be the root issue.
I might look deeper tomorrow but this is a strange endpoint...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well!
Description
default_type_id
type in animal_uses API to number (it was used as map keys and converted to string)==
!!!)Jira link: N/A
Type of change
How Has This Been Tested?
Checklist: