From 0546b75450b4a3cefcb115d2746e694532619b56 Mon Sep 17 00:00:00 2001 From: Stephen Hand Date: Mon, 16 Dec 2024 18:59:19 +0000 Subject: [PATCH] Fix prepopulate call --- functions/hrm/prepopulateForm.ts | 2 +- .../taskrouterListeners/createHrmContactListener.private.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/hrm/prepopulateForm.ts b/functions/hrm/prepopulateForm.ts index 18f771eb..d132eefe 100644 --- a/functions/hrm/prepopulateForm.ts +++ b/functions/hrm/prepopulateForm.ts @@ -463,4 +463,4 @@ export const prepopulateForm = async ( return contact; }; -export type PrepopulateForm = typeof prepopulateForm; +export type PrepopulateForm = { prepopulateForm: typeof prepopulateForm }; diff --git a/functions/taskrouterListeners/createHrmContactListener.private.ts b/functions/taskrouterListeners/createHrmContactListener.private.ts index 338c86b5..8f5aa86d 100644 --- a/functions/taskrouterListeners/createHrmContactListener.private.ts +++ b/functions/taskrouterListeners/createHrmContactListener.private.ts @@ -123,8 +123,8 @@ export const handleEvent = async ( }; const prepopulatePath = Runtime.getFunctions()['hrm/prepopulateForm'].path; - const prepopulate = require(prepopulatePath) as PrepopulateForm; - await prepopulate(taskAttributes, contactForApi, formDefinitionsVersionUrl); + const { prepopulateForm } = require(prepopulatePath) as PrepopulateForm; + await prepopulateForm(taskAttributes, contactForApi, formDefinitionsVersionUrl); const options: RequestInit = { method: 'POST', body: JSON.stringify(contactForApi),