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