hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.26k stars 281 forks source link

🪲 Fix make_response incorrectly sending `text` instead of JSON #5599

Closed jpelay closed 2 weeks ago

jpelay commented 3 weeks ago

5558 Introduced an error where some calls where expecting a JSON, and got text instead. I checked the places where this happened and fix the calls.

If I'm missing some, please add them 😄

How to test Perform the following:

And all of them should show the success modal!

Also: Fixes #5550

Annelein commented 3 weeks ago

We've found another error, I will solve this tomorrow!

jpelay commented 3 weeks ago

@Annelein I fixed the achievements issue! Can you check again please?

Annelein commented 2 weeks ago

@jpelay I've changed some 204's to 200's, because the make_response might not have content, but there might be a check for response.achievements on the frontend, which will result in an error if it's a 204.

Only comment left is about response instead of response_body, otherwise I will approve!

**btw I can also add a check in the frontend for response and then make it a 204 instead?

jpelay commented 2 weeks ago

@jpelay I've changed some 204's to 200's, because the make_response might not have content, but there might be a check for response.achievements on the frontend, which will result in an error if it's a 204.

Perfect, thanks!

Only comment left is about response instead of response_body, otherwise I will approve!

What's the comment?

mergify[bot] commented 2 weeks ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

mergify[bot] commented 2 weeks ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).