Skip to content

Commit

Permalink
fix custom field autofield populating issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aatbip committed Feb 28, 2024
1 parent 9f2a1de commit a58752c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/client-preview/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,21 @@ export default async function ClientPreviewPage({
const company = await getCompany(_client.companyId, token)

const template = Handlebars?.compile(settings?.content)

//add comma separator for custom fields
const customFields: any = _client?.customFields

Check warning on line 70 in src/app/client-preview/page.tsx

View workflow job for this annotation

GitHub Actions / Run linters

Unexpected any. Specify a different type
for (const key in customFields) {
if (Array.isArray(customFields[key])) {
//element[0].toUpperCase() + element.substring(1) is a hack to capitalize the first string, however changes in SDK response
//is required.
customFields[key] = customFields[key].map(
(element: any) => ' ' + element[0].toUpperCase() + element.substring(1),

Check warning on line 76 in src/app/client-preview/page.tsx

View workflow job for this annotation

GitHub Actions / Run linters

Unexpected any. Specify a different type
)
}
}
const client = {
..._client,
...(Object.keys(customFields as object).length && customFields),
company: company.name,
}

Expand Down

0 comments on commit a58752c

Please sign in to comment.