From 9c989107e7f56e58e062284114ef7c148c30bce9 Mon Sep 17 00:00:00 2001 From: benjaminramey Date: Wed, 28 Aug 2024 12:43:53 -0500 Subject: [PATCH] vault backup: 2024-08-28 12:43:53 --- Daily Notes/2024/08/2024-08-28 (Wednesday).md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Daily Notes/2024/08/2024-08-28 (Wednesday).md b/Daily Notes/2024/08/2024-08-28 (Wednesday).md index 1c84f69..316f2d9 100644 --- a/Daily Notes/2024/08/2024-08-28 (Wednesday).md +++ b/Daily Notes/2024/08/2024-08-28 (Wednesday).md @@ -1,4 +1,20 @@ # Work +After a lot of head-banging to get this stupid builder.io query to work for the next.js site's PDP to get product-page content, I finally found the answer. The call to builder needs to look like this: +``` +const content = await builder + .get('product-page', { + query: { + data: { + logosProductId: `'${logosProductId}'`, + }, + }, + prerender: false, + }) + .toPromise(); +``` +The part I couldn't get right was the `query.data.logosProductId` part. The single quotes around the ID appear to be essential. + +I also read up on next.js's app routing because that has effects for when/where (server or client) the data is fetched. The older `getStaticProps` and `getServerSideProps` don't exist anymore. Basically, unless `'use client;'` is set somewhere, it happens on the server. # Meetings ## Commerce Scrum