summaryrefslogtreecommitdiff
path: root/srv/src/http/posts.go
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-21 11:20:45 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-21 11:20:45 -0600
commite269b111a18c8822b0c16f1567548bc598b25997 (patch)
treef025a7e34e9905e4f51263c70c27e8a66d644677 /srv/src/http/posts.go
parent3059909deb5e21746d3d95e4989a78db51ccec33 (diff)
List existing tags on edit post page
Diffstat (limited to 'srv/src/http/posts.go')
-rw-r--r--srv/src/http/posts.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/srv/src/http/posts.go b/srv/src/http/posts.go
index daa756c..c05f3de 100644
--- a/srv/src/http/posts.go
+++ b/srv/src/http/posts.go
@@ -205,7 +205,21 @@ func (a *api) renderEditPostHandler() http.Handler {
}
}
- executeTemplate(rw, r, tpl, storedPost)
+ tags, err := a.params.PostStore.GetTags()
+ if err != nil {
+ apiutil.InternalServerError(rw, r, fmt.Errorf("fetching tags: %w", err))
+ return
+ }
+
+ tplPayload := struct {
+ Post post.StoredPost
+ Tags []string
+ }{
+ Post: storedPost,
+ Tags: tags,
+ }
+
+ executeTemplate(rw, r, tpl, tplPayload)
})
}