Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
showConfirmation(async () => {
const { data: res } = await deleteElement({
variables: { id }
});
const { error } = res.pageBuilder.deleteElement;
if (error) {
return showSnackbar(error.message);
}
unregisterPlugin(plugin);
refresh();
showSnackbar(
<span>
Element <strong>{title}</strong> deleted!
</span>
);
});
},
deleteBlock = async ({ plugin, deleteElement }) => {
const { showSnackbar } = this.props;
const response = await deleteElement({
variables: {
id: plugin.id
}
});
const { error } = response.data.cms.pageBuilder.deleteElement;
if (error) {
showSnackbar(error.message);
return;
}
unregisterPlugin(plugin.name);
showSnackbar("Block " + plugin.title + " successfully deleted.");
};
deleteBlock = async ({ plugin, deleteElement }) => {
const { showSnackbar } = this.props;
const response = await deleteElement({
variables: {
id: plugin.id
}
});
const { error } = response.data.pageBuilder.deleteElement;
if (error) {
showSnackbar(error.message);
return;
}
unregisterPlugin(plugin.name);
showSnackbar("Block " + plugin.title + " successfully deleted.");
};