Grow journal: time-stamped notes on gardens, beds and plantings (#52) (#65)
Build image / build-and-push (push) Successful in 6s
Build image / build-and-push (push) Successful in 6s
Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #65.
This commit is contained in:
@@ -85,6 +85,10 @@ func New(cfg *config.Config, svc *service.Service) *gin.Engine {
|
||||
gardens.GET("/:id/full", h.getGardenFull) // one-shot editor load
|
||||
gardens.GET("/:id/history", h.getGardenHistory) // change sets, newest first
|
||||
gardens.POST("/:id/objects", h.createObject)
|
||||
// The grow journal hangs off a garden even for entries about one bed or one
|
||||
// plop, so it inherits the ordinary garden-role check.
|
||||
gardens.GET("/:id/journal", h.listJournal)
|
||||
gardens.POST("/:id/journal", h.createJournalEntry)
|
||||
|
||||
// Sharing (owner-managed; a recipient may remove their own share).
|
||||
gardens.GET("/:id/shares", h.listShares)
|
||||
@@ -117,6 +121,12 @@ func New(cfg *config.Config, svc *service.Service) *gin.Engine {
|
||||
changeSets := v1.Group("/change-sets", h.requireAuth())
|
||||
changeSets.POST("/:id/revert", h.revertChangeSet)
|
||||
|
||||
// Journal entries are addressed by their own id; the service resolves the
|
||||
// owning garden for the permission check, same as objects and plantings.
|
||||
journal := v1.Group("/journal", h.requireAuth())
|
||||
journal.PATCH("/:id", h.updateJournalEntry)
|
||||
journal.DELETE("/:id", h.deleteJournalEntry)
|
||||
|
||||
// Plant catalog: built-ins (seeded, read-only) plus the actor's own rows.
|
||||
plants := v1.Group("/plants", h.requireAuth())
|
||||
plants.GET("", h.listPlants)
|
||||
|
||||
Reference in New Issue
Block a user