File "get-block-content.js"

Full Path: /home/fresvfqn/waterdamagerestorationandrepairsmithtown.com/wp-content/plugins/extendify/src/Agent/workflows/dom-highlighter/tools/get-block-content.js
File size: 406 bytes
MIME-type: text/x-java
Charset: utf-8

import apiFetch from '@wordpress/api-fetch';
import { useWorkflowStore } from '@agent/state/workflows';

export default async () => {
	const { block } = useWorkflowStore.getState();
	const { postId } = window.extAgentData.context;
	const response = await apiFetch({
		path: `/extendify/v1/agent/get-block-code?postId=${postId}&blockId=${block}`,
	});
	return { previousContent: response?.block ?? '' };
};