Skip to content
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

fixed sending array in AJAX request #207

Closed
wants to merge 1 commit into from
Closed

fixed sending array in AJAX request #207

wants to merge 1 commit into from

Conversation

petrparolek
Copy link

closes #202

@codecov
Copy link

codecov bot commented Jan 18, 2021

Codecov Report

Merging #207 (3a9a8de) into master (35f2a20) will decrease coverage by 0.96%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
- Coverage   84.34%   83.38%   -0.97%     
==========================================
  Files          11       11              
  Lines         345      349       +4     
  Branches       99      100       +1     
==========================================
  Hits          291      291              
- Misses         21       24       +3     
- Partials       33       34       +1     
Impacted Files Coverage Δ
src/Naja.ts 89.85% <0.00%> (-5.53%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35f2a20...3a9a8de. Read the comment docs.

@petrparolek
Copy link
Author

thanks @DzeryCZ very much for providing a lot of helps with fixing.

@jiripudil
Copy link
Member

jiripudil commented Jan 19, 2021

Hello, first of all, thanks for the contribution, every helping hand counts!

This definitely goes in the right direction, but since this issue is already on the table, I'd like to have it fixed properly, i.e.

  • Naja should transform everything that PHP and/or Nette can correctly parse, including arrays (key[]=value), objects (key[subkey]=value), and any arbitrarily nested structures (key[subkey][0][subkey]=value).
  • In addition to GET and HEAD requests where data need to be serialized into the query string, the same transformation also needs to be done to application/x-www-form-urlencoded request body – currently it suffers from pretty much the same bug on this line.
  • Needless to say, this kind of change needs a decent test coverage.

Let me know if you're willing to put more effort into this, I might have some thoughts on how this could be implemented. Otherwise I might be able to find some time for this during this or the following week. I believe this is not a blocker, as you can always build the URL in your code until this is fixed.

@petrparolek
Copy link
Author

I am not good at Javascript. It's up to you. Could you fix it in your way?

@jiripudil
Copy link
Member

I am not good at Javascript. It's up to you. Could you fix it in your way?

Sure, no worries :) by the way your code is really not bad, it's just that the scope of the problem is larger than you expected.

@jiripudil jiripudil closed this Jan 19, 2021
@petrparolek
Copy link
Author

code is from my friend @DzeryCZ .

@jiripudil
Copy link
Member

Well then, thanks to both of you for putting your time and effort into this!

@petrparolek petrparolek deleted the 202-fixed-sending-array branch February 5, 2021 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nette does not receive array
2 participants