Skip to content

Commit

Permalink
remove unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
ethangardner committed Oct 11, 2024
1 parent 02c4a8d commit f31e202
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/forms/src/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ const parsePromptResponse = (
const values: Record<string, any> = {};
const errors: FormErrorMap = {};
for (const [patternId, promptValue] of Object.entries(response.data)) {
const id = getPatternId(patternId);
const pattern = getPattern(session.form, id);
const pattern = getPattern(session.form, patternId);
const patternConfig = getPatternConfig(config, pattern.type);
const isValidResult = validatePattern(patternConfig, pattern, promptValue);
if (isValidResult.success) {
Expand All @@ -51,7 +50,3 @@ const parsePromptResponse = (
}
return { errors, values };
};

const getPatternId = (id: string) => {
return id.replace(/_repeater_(\d+)$/, '');
};

0 comments on commit f31e202

Please sign in to comment.