Skip to content

Commit

Permalink
Update forms.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jdinh8124 committed Nov 17, 2023
1 parent ba5ae5d commit 7c7efe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/api/handlers/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const forms = async (event: APIGatewayEvent) => {
try {
if (!formVersion) formVersion = getMaxVersion(formId);

const module = await import(`/opt/${formId}/v${formVersion}.js`);
const module = await import(`/opt/${formId}/v${formVersion}`);
console.log(module);
console.log(module[formId]);
form = module[formId];
Expand Down Expand Up @@ -72,13 +72,13 @@ export function getFilepathForIdAndVersion(
formVersion: string | undefined
): string | undefined {
if (formId && formVersion) {
return `/opt/${formId}/v${formVersion}.js`;
return `/opt/${formId}/v${formVersion}`;
}

const maxVersion = getMaxVersion(formId);

if (!maxVersion) return undefined;
return `/opt/${formId}/v${maxVersion}.js`;
return `/opt/${formId}/v${maxVersion}`;
}

export const handler = forms;

0 comments on commit 7c7efe7

Please sign in to comment.