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

formData identical keys #310

Open
noirscape opened this issue Apr 28, 2023 · 0 comments
Open

formData identical keys #310

noirscape opened this issue Apr 28, 2023 · 0 comments

Comments

@noirscape
Copy link
Contributor

noirscape commented Apr 28, 2023

Firstly, please correct me if I'm making any mistakes, but I don't think I am.

It is possible to have multiple entries with the same formData name - this is how, for example, clients send over file uploads that accept multiple files (in my example, I've written a PWA that tries to handle multiple files as a share target serverside). Unfortunately, it is deprecated to have a Table with duplicate keys (the add procedure is even being deprecated in favor of just doing []= assignments) and the allValues() procedure doesn't work with the OrderedTable that jester uses.

This means it's currently impossible to actually retrieve multiple entries from a table unless you manually iterate over pairs or values and manually check the key on the former/read out the fields table on the latter.

One possible solution could be to redefine the MultiData object to be an OrderedTable[string, seq[tuple[fields: StringTableRef, body: string]]] instead and append to the sequence instead, but this would probably hard break existing applications.

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

No branches or pull requests

1 participant