Created
November 2, 2020 22:10
-
-
Save oddevan/f99f31381e2d4c46261908f9058a5788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function fetchAndSetResponse(url, setAttributes) { | |
const oEmbedUrl = `oddevan/v1/devArtProxy?url=${encodeURIComponent(url)}`; | |
try { | |
const response = await apiFetch({ path: oEmbedUrl }); | |
setAttributes({ embedData: response }); | |
} catch(e) { | |
console.log('Error in DA block', { url: oEmbedUrl, error: e }); | |
setAttributes({ embedData: {} }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment