feat: Adds update path to equivalent length form / database / view routes.
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user