feat: Adds update path to equivalent length form / database / view routes.

This commit is contained in:
2026-01-07 17:31:54 -05:00
parent f8bed40670
commit 79b7892d9a
11 changed files with 460 additions and 118 deletions

View File

@@ -22,7 +22,7 @@ extension SiteRoute.View.ProjectRoute.EquivalentLengthRoute.StepThree {
value: Double(groupLengths[n]),
quantity: groupQuantities[n]
)
)
)
}
return groups
@@ -44,3 +44,21 @@ extension EffectiveLength.Create {
)
}
}
extension EffectiveLength.Update {
init(
form: SiteRoute.View.ProjectRoute.EquivalentLengthRoute.StepThree,
projectID: Project.ID
) throws {
guard let id = form.id else {
throw ValidationError("Id not found.")
}
self.init(
id: id,
name: form.name,
type: form.type,
straightLengths: form.straightLengths,
groups: form.groups
)
}
}