plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

feat(upload): Added body to download function

Open enri90 opened this issue 1 year ago • 3 comments

Added post functionality to the download function Example

const body = JSON.stringify({ ids: ids });

await download(
  url,
  path,
  ({ progress, total }) => console.log(`Downloaded ${progress} of ${total} bytes`),
  new Map<string, string>([
    ['Content-Type', 'application/json'],
  ]),
  body
);

enri90 avatar Jul 06 '24 12:07 enri90

Sorry for the long delay in your first PR. What do you think about leveraging the native Request object for the url and body?

Basically mirroring the http plugin: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/http/guest-js/index.ts#L104

Let me know what you think and whether you'd be open to work on it (if you agree) or if i should take over :)

FabianLars avatar Jul 08 '24 12:07 FabianLars

Sorry for the long delay in your first PR. What do you think about leveraging the native Request object for the url and body?

Basically mirroring the http plugin: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/http/guest-js/index.ts#L104

Let me know what you think and whether you'd be open to work on it (if you agree) or if i should take over :)

Hi! Thank you for the feedback. I understand the request to leverage the native Request object for the URL and body and think it's a good idea. However, I'm not very familiar with Rust and am not sure how to implement this. If you could take over this part, that would be fantastic. Thanks!

enri90 avatar Jul 09 '24 13:07 enri90

Okay sure, no problem!

FabianLars avatar Jul 09 '24 13:07 FabianLars

Package Changes Through d98edb97743a6e003c5a7685b15f1d3e508a629e

There are 2 changes which include upload with patch, upload-js with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
upload 2.2.0 2.2.1
upload-js 2.2.0 2.2.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

github-actions[bot] avatar Oct 25 '24 15:10 github-actions[bot]

i changed my mind, let's keep it simple for now.

FabianLars avatar Dec 03 '24 12:12 FabianLars