Skip to content

Commit

Permalink
PDF ingest: parse fieldsets that contain checkboxes (#153)
Browse files Browse the repository at this point in the history
* parse fieldsets that contain checkboxes

* api url
  • Loading branch information
jimmoffet authored Jun 4, 2024
1 parent 6c63447 commit 01f7d5a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/forms/src/documents/pdf/parsing-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,27 @@ export const processApiResponse = async (json: any): Promise<ParsedPdf> => {
};
}
}
// TODO: Look for checkbox or other element types
if (input.component_type === 'checkbox') {
const checkboxPattern = processPatternData<CheckboxPattern>(
defaultFormConfig,
parsedPdf,
'checkbox',
{
label: input.label,
defaultChecked: false,
}
);
if (checkboxPattern) {
fieldsetPatterns.push(checkboxPattern.id);
parsedPdf.outputs[checkboxPattern.id] = {
type: 'CheckBox',
name: input.id,
label: input.label,
value: false,
required: true,
};
}
}
}
}

Expand Down

0 comments on commit 01f7d5a

Please sign in to comment.