From 752ee52dcd487253bc1662b1ba157732f73d27cf Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 12 Feb 2024 13:57:52 +0000 Subject: wip: mating EPs with Operations --- cmd/web/handlers.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cmd/web/handlers.go') diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index e27b39b..0a7be55 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -13,11 +13,22 @@ import ( func (app *application) listOperations(w http.ResponseWriter, r *http.Request) { ops, err := app.operations.ListAll() - if err != nil { app.serverError(w, r, err) return } + + var esses []models.EngagementStrategy + + for _, op := range ops { + es, err := app.engagement_strategies.GetForOperation(op.ID) + // TODO: Check what kind of error this is, don't just continue + if err != nil { + continue + } + esses = append(esses, es) + } + files := []string{ "./ui/html/base.tmpl.html", "./ui/html/pages/operations/list.tmpl.html", -- cgit v1.2.3