fix: add sdk as script
This commit is contained in:
@@ -10,6 +10,7 @@ import Hero from "@/components/Current/Hero";
|
||||
|
||||
import type { PageArgs, LangParams, UriParams } from "@/types/params";
|
||||
import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage";
|
||||
import ContentstackLivePreview from "@contentstack/live-preview-utils";
|
||||
|
||||
export default async function CurrentContentPage({
|
||||
params,
|
||||
@@ -17,6 +18,7 @@ export default async function CurrentContentPage({
|
||||
}: PageArgs<LangParams, UriParams>) {
|
||||
try {
|
||||
console.log({ searchParams });
|
||||
ContentstackLivePreview.setConfigFromParams(searchParams);
|
||||
if (!searchParams.uri) {
|
||||
throw new Error("Bad URI");
|
||||
}
|
||||
@@ -26,6 +28,10 @@ export default async function CurrentContentPage({
|
||||
{ locale: params.lang, url: searchParams.uri }
|
||||
);
|
||||
|
||||
if (!response) {
|
||||
return <h1>No Hash recieved! Hash: {ContentstackLivePreview.hash}</h1>;
|
||||
}
|
||||
|
||||
if (!response.data?.all_current_blocks_page?.total) {
|
||||
console.log("#### DATA ####");
|
||||
console.log(response.data);
|
||||
|
||||
Reference in New Issue
Block a user