Configurable grid + snap-to-grid in the layout system (#45)
Build image / build-and-push (push) Successful in 7s
Build image / build-and-push (push) Successful in 7s
Closes #44. Two independent grids (garden + per-bed), each with a size and a snap toggle; snapping defaults off. See PR #45 for details. Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #45.
This commit is contained in:
+11
-6
@@ -14,15 +14,20 @@ import (
|
||||
// Dimensions are centimeters (the API is metric-only; imperial is a display
|
||||
// concern). On create, omitted dimensions default server-side.
|
||||
type gardenFields struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
WidthCM float64 `json:"widthCm"`
|
||||
HeightCM float64 `json:"heightCm"`
|
||||
UnitPref string `json:"unitPref"`
|
||||
Notes string `json:"notes"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
WidthCM float64 `json:"widthCm"`
|
||||
HeightCM float64 `json:"heightCm"`
|
||||
UnitPref string `json:"unitPref"`
|
||||
Notes string `json:"notes"`
|
||||
GridSizeCM float64 `json:"gridSizeCm"`
|
||||
SnapToGrid bool `json:"snapToGrid"`
|
||||
}
|
||||
|
||||
func (f gardenFields) toInput() service.GardenInput {
|
||||
return service.GardenInput{Name: f.Name, WidthCM: f.WidthCM, HeightCM: f.HeightCM, UnitPref: f.UnitPref, Notes: f.Notes}
|
||||
return service.GardenInput{
|
||||
Name: f.Name, WidthCM: f.WidthCM, HeightCM: f.HeightCM, UnitPref: f.UnitPref, Notes: f.Notes,
|
||||
GridSizeCM: f.GridSizeCM, SnapToGrid: f.SnapToGrid,
|
||||
}
|
||||
}
|
||||
|
||||
// gardenCreateRequest / gardenUpdateRequest are the JSON bodies. Update adds a
|
||||
|
||||
Reference in New Issue
Block a user