Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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