wip: pass preview data

This commit is contained in:
2025-09-24 10:55:49 -04:00
parent b11e1b3dc4
commit b8954be7eb
3 changed files with 14 additions and 8 deletions

View File

@@ -33,9 +33,7 @@
"toggle",
"copy"
],
"acfe_flexible_remove_button": [
"add"
],
"acfe_flexible_remove_button": [],
"acfe_flexible_modal_edit": {
"acfe_flexible_modal_edit_enabled": "1",
"acfe_flexible_modal_edit_size": "xlarge"
@@ -161,5 +159,5 @@
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1758715372
"modified": 1758719135
}

View File

@@ -1,5 +1,11 @@
<?php
$preview_url = ( defined( 'NUXT_PUBLIC_SITE_URL' ) ? NUXT_PUBLIC_SITE_URL : 'https://cultureat.ca' ) . '/api/acf-preview';
$result = wp_remote_get( $preview_url, array( 'method' => 'POST' ) );
?>
<pre><?= $result['body'] ?></pre>
$data = array(
'layout' => get_row_layout(),
);
$result = wp_remote_post( $preview_url, array( 'body' => $data ) );
if ( is_wp_error( $result ) ) {
echo '<div style="color: red;">Erreur: ' . esc_html( $result->get_error_message() ) . '</div>';
} else {
echo $result['body'];
}

View File

@@ -1,3 +1,5 @@
export default defineEventHandler(() => {
export default defineEventHandler(async (event) => {
const body = await readBody(event);
console.log(body);
return `<div>TODO: Preview from Nuxt API endpoint</div>`;
});