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 image upload modal and CORS violation #36

Merged
merged 9 commits into from
Oct 18, 2024
Merged

Fixed image upload modal and CORS violation #36

merged 9 commits into from
Oct 18, 2024

Conversation

zuzanna-maria
Copy link
Collaborator

  • 'Choose' button added to upload modal
  • Image upload now done through fetchAPI and conversion to blob
  • createShare deleted

@zuzanna-maria zuzanna-maria requested a review from wginolas October 7, 2024 11:41
src/editor.js Outdated
}
}
return {}
async function uploadImg(shareLink) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be called downloadImg?

const myRequest = new Request(shareLink)
let blob
/* eslint-disable no-unused-vars */
const response = await fetch(myRequest)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to mix await and .then(). You can write something like this:

const response = await fetch(myRequest)
const blob = await request.blob()

@wginolas wginolas merged commit 6da61db into main Oct 18, 2024
8 of 22 checks passed
@wginolas wginolas deleted the img_upload branch October 18, 2024 12:45
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.

2 participants