diff --git a/src/app/portal/admin/actions.ts b/src/app/portal/admin/actions.ts index a1288f59..2b36c841 100644 --- a/src/app/portal/admin/actions.ts +++ b/src/app/portal/admin/actions.ts @@ -100,7 +100,6 @@ export async function getAllFormDetails( formId: bigint, ): Promise<{ rawForm: any; formFields: FormFields; submissions: any[] }> { try { - console.log("retrieving form details"); const form = await db.forms.findFirst({ where: { id: formId }, }); diff --git a/src/components/forms/applications/offerPage.tsx b/src/components/forms/applications/offerPage.tsx index 7369aa3d..faa098e3 100644 --- a/src/components/forms/applications/offerPage.tsx +++ b/src/components/forms/applications/offerPage.tsx @@ -21,7 +21,7 @@ export default function OfferPage({ form, app }: { form: Form; app: any }) { const lpData = useContext(lpContext); const cleanedText = replaceTemplateValues(text, { general: lpData, - app: { ...rest, ...details }, + app: { ...rest.applications, ...details }, }); async function handleDecision(decision: "accepted" | "declined") { @@ -126,13 +126,10 @@ function replaceTemplateValues( matches.forEach((match) => { const key = match.replace("{{", "").replace("}}", ""); const multiKey = key.split(":"); - if (multiKey.length > 1) { const [firstKey, secondKey] = multiKey; if (Object.keys(app).includes(secondKey)) { - if (app[secondKey] === undefined) { - newText = ""; - } else { + if (app[secondKey] !== undefined) { if (multiKey.length > 2) { const thirdKey = multiKey[2]; newText = newText.replace(