summaryrefslogtreecommitdiff
path: root/src/http/posts.go
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2024-05-26 21:16:02 +0200
committerBrian Picciano <mediocregopher@gmail.com>2024-05-26 21:16:02 +0200
commit43d8951296ce2f232ca94f0577e2e726291bf783 (patch)
treea04793b1e15e10040201dfafd1c25c649030f72c /src/http/posts.go
parenta6342a3748beaee1ec3c2dc662af6deec0c3959d (diff)
Replace URL building methods with the URLBuilder
Diffstat (limited to 'src/http/posts.go')
-rw-r--r--src/http/posts.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/http/posts.go b/src/http/posts.go
index daaaafc..8488996 100644
--- a/src/http/posts.go
+++ b/src/http/posts.go
@@ -30,13 +30,6 @@ func (a *api) postPreprocessFuncImage(args ...string) (string, error) {
}
tpl := txttpl.New("image.html")
-
- tpl.Funcs(txttpl.FuncMap{
- "AssetURL": func(id string) string {
- return a.assetURL(id, false)
- },
- })
-
tpl = txttpl.Must(tpl.Parse(mustReadTplFile("image.html")))
tplPayload := struct {
@@ -189,7 +182,9 @@ func (a *api) postPostHandler() http.Handler {
return
}
- a.executeRedirectTpl(rw, r, a.editPostURL(p.ID, false))
+ a.executeRedirectTpl(
+ rw, r, a.urlBuilder.Post(p.ID).MethodEdit().String(),
+ )
})
}
@@ -223,9 +218,13 @@ func (a *api) deletePostHandler(isDraft bool) http.Handler {
}
if isDraft {
- a.executeRedirectTpl(rw, r, a.manageDraftPostsURL(false))
+ a.executeRedirectTpl(
+ rw, r, a.urlBuilder.Drafts().MethodManage().String(),
+ )
} else {
- a.executeRedirectTpl(rw, r, a.managePostsURL(false))
+ a.executeRedirectTpl(
+ rw, r, a.urlBuilder.Posts().MethodManage().String(),
+ )
}
})
}