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

fix(components): [upload] fix empty array error #13490

Merged
merged 2 commits into from
Aug 13, 2023
Merged

fix(components): [upload] fix empty array error #13490

merged 2 commits into from
Aug 13, 2023

Conversation

youpinyao
Copy link
Contributor

@youpinyao youpinyao commented Jul 6, 2023

在 components/upload/src/ajax.ts 73 行中,如果data 中key对应的value 是空数组的情况下if (Array.isArray(value)) formData.append(key, ...value)报错

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Description

🤖 Generated by Copilot at a69c768

Fix a bug in ajaxUpload that caused an error with empty array values in option.data. Add a test case for this scenario in ajax.ts.

Related Issue

Fixes #___.

Explanation of Changes

🤖 Generated by Copilot at a69c768

  • Fix a bug where empty array values in option.data cause errors when appending to formData (link)

@pull-request-triage
Copy link

👋 @youpinyao, seems like this is your first time contribution to element-plus.

  • Please make sure that you have read our guidelines and code of conduct before making a contribution.
  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

@pull-request-triage pull-request-triage bot added 1st contribution Their very first contribution Needs Review labels Jul 6, 2023
@github-actions
Copy link

github-actions bot commented Jul 6, 2023

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

Hello @youpinyao, thank you for contributing to element-plus, please see our guideline to see how to make contribution

@chenxch
Copy link
Member

chenxch commented Jul 6, 2023

@youpinyao Thank you for your contribution. If it is convenient, please modify the title according to the specification.

@btea
Copy link
Collaborator

btea commented Aug 10, 2023

@chenxch This pr has not responded for too long, maybe we can modify it directly and then merge it? 🤔

在 components/upload/src/ajax.ts 73 行中,如果data 中key对应的value 是空数组的情况下`if (Array.isArray(value)) formData.append(key, ...value)`报错
@btea btea changed the title Update ajax.ts fix(components): [upload] fix empty array error Aug 11, 2023
@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Aug 11, 2023
@github-actions
Copy link

🧪 Playground Preview: https://element-plus.run/?pr=13490
Please comment the example via this playground if needed.

@btea btea merged commit 5c13061 into element-plus:dev Aug 13, 2023
10 checks passed
@element-bot element-bot mentioned this pull request Aug 25, 2023
3 tasks
laizuan pushed a commit to laizuan/element-plus that referenced this pull request Sep 5, 2023
* fix(components): [upload] fix empty array error

在 components/upload/src/ajax.ts 73 行中,如果data 中key对应的value 是空数组的情况下`if (Array.isArray(value)) formData.append(key, ...value)`报错

* fix: reuse isArray

---------

Co-authored-by: btea <2356281422@qq.com>
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this pull request Nov 10, 2023
* fix(components): [upload] fix empty array error

在 components/upload/src/ajax.ts 73 行中,如果data 中key对应的value 是空数组的情况下`if (Array.isArray(value)) formData.append(key, ...value)`报错

* fix: reuse isArray

---------

Co-authored-by: btea <2356281422@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants