From e505d310ad4b235410bff6fe817c5fc3c3d29e25 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Fri, 12 Jul 2024 12:37:29 +0300 Subject: [PATCH] Fix failing build --- apps/roboshield/.env | 2 ++ apps/roboshield/src/payload/utils/formatDraftUrl.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/apps/roboshield/.env b/apps/roboshield/.env index bd685430f..70e4388ba 100644 --- a/apps/roboshield/.env +++ b/apps/roboshield/.env @@ -9,3 +9,5 @@ SENTRY_PROJECT=roboshield NEXT_PUBLIC_IMAGE_DOMAINS="*.codeforafrica.org" NEXT_PUBLIC_IMAGE_UNOPTIMIZED="true" + +NEXT_PUBLIC_APP_URL=http://localhost:3000 diff --git a/apps/roboshield/src/payload/utils/formatDraftUrl.ts b/apps/roboshield/src/payload/utils/formatDraftUrl.ts index dbfe69ecf..714a7e111 100644 --- a/apps/roboshield/src/payload/utils/formatDraftUrl.ts +++ b/apps/roboshield/src/payload/utils/formatDraftUrl.ts @@ -3,6 +3,7 @@ import { Document } from "payload/types"; const payloadUrl = process.env.PAYLOAD_PUBLIC_APP_URL || process.env.NEXT_PUBLIC_APP_URL; + function formatDraftUrl(collection: string, doc: Document) { const pagePath = formatPagePath(collection, doc); if (pagePath) {