diff --git a/controllers/threads_controller.go b/controllers/threads_controller.go index cafc407..8320e3b 100644 --- a/controllers/threads_controller.go +++ b/controllers/threads_controller.go @@ -212,7 +212,8 @@ func CreateThread(c *fiber.Ctx) error { tx.Commit(context.TODO()) - return c.Redirect("/"+strconv.Itoa(threadID), fiber.StatusFound) + path := "/" + strconv.Itoa(threadID) + return c.Redirect(path, fiber.StatusFound) } // Add new post in thread @@ -363,6 +364,6 @@ func UpdateThread(c *fiber.Ctx) error { tx.Commit(context.TODO()) - c.Append("Refresh", "0") - return c.SendStatus(fiber.StatusCreated) + path := "/" + strconv.Itoa(threadID) + "#" + strconv.Itoa(postID) + return c.Redirect(path) } diff --git a/templates/components/post.html b/templates/components/post.html index 97c386e..93f5bb3 100644 --- a/templates/components/post.html +++ b/templates/components/post.html @@ -1,5 +1,5 @@ {{ define "post" }} -
+