From 64732af4d3c723970166072275a8c714fd861b86 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Sun, 24 Oct 2021 18:02:07 +0200 Subject: [PATCH] Fix update button on home-posts --- editor.go | 9 ++------- templates/post.gohtml | 2 +- templates/statichome.gohtml | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/editor.go b/editor.go index 8c3226a..b121cae 100644 --- a/editor.go +++ b/editor.go @@ -29,12 +29,7 @@ func (a *goBlog) serveEditorPost(w http.ResponseWriter, r *http.Request) { if action := r.FormValue("editoraction"); action != "" { switch action { case "loadupdate": - parsedURL, err := url.Parse(r.FormValue("url")) - if err != nil { - a.serveError(w, r, err.Error(), http.StatusBadRequest) - return - } - post, err := a.getPost(parsedURL.Path) + post, err := a.getPost(r.FormValue("path")) if err != nil { a.serveError(w, r, err.Error(), http.StatusBadRequest) return @@ -42,7 +37,7 @@ func (a *goBlog) serveEditorPost(w http.ResponseWriter, r *http.Request) { a.render(w, r, templateEditor, &renderData{ BlogString: blog, Data: map[string]interface{}{ - "UpdatePostURL": parsedURL.String(), + "UpdatePostURL": a.fullPostURL(post), "UpdatePostContent": a.postToMfItem(post).Properties.Content[0], }, }) diff --git a/templates/post.gohtml b/templates/post.gohtml index 520f779..f7950d5 100644 --- a/templates/post.gohtml +++ b/templates/post.gohtml @@ -25,7 +25,7 @@
- +
diff --git a/templates/statichome.gohtml b/templates/statichome.gohtml index 83afbee..7a93cc0 100644 --- a/templates/statichome.gohtml +++ b/templates/statichome.gohtml @@ -19,7 +19,7 @@
- +