feat(#12): Add subsections to sections, fix version deletion after update
This commit is contained in:
@@ -72,8 +72,10 @@ export function compareApplicationForms(
|
||||
function flattenFormElements(form: ApplicationFormDto): Array<{ element: FormElementDto; sectionTitle: string }> {
|
||||
const elements: Array<{ element: FormElementDto; sectionTitle: string }> = []
|
||||
for (const section of form.formElementSections) {
|
||||
for (const element of section.formElements) {
|
||||
for (const subsection of section.formElementSubSections) {
|
||||
for (const element of subsection.formElements) {
|
||||
elements.push({ element, sectionTitle: section.title })
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements
|
||||
@@ -84,8 +86,10 @@ function flattenSnapshotElements(
|
||||
): Array<{ element: FormElementSnapshotDto; sectionTitle: string }> {
|
||||
const elements: Array<{ element: FormElementSnapshotDto; sectionTitle: string }> = []
|
||||
for (const section of snapshot.sections) {
|
||||
for (const element of section.elements) {
|
||||
for (const subsection of section.subsections) {
|
||||
for (const element of subsection.elements) {
|
||||
elements.push({ element, sectionTitle: section.title })
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements
|
||||
|
||||
Reference in New Issue
Block a user