mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2026-10-21 01:34:22 +00:00
1 parent
665d33d9d3
commit
aacabdd54d
4 files changed
+63
-47
No files matched your search
+3
-3
@@ -10,9 +10,9 @@ import (
|
||||
)
|
||||
|
||||
func show(c *fiber.Ctx) error {
|
||||
postId := c.Params("id", "")
|
||||
postId := converters.ConvertId(c)
|
||||
if postId == "" {
|
||||
return c.Redirect("/")
|
||||
return c.Status(422).SendString("Invalid post ID")
|
||||
}
|
||||
|
||||
e, err := client.PostData(postId)
|
||||
@@ -42,5 +42,5 @@ func index(c *fiber.Ctx) error {
|
||||
|
||||
func RegisterRoutes(app *fiber.App) {
|
||||
app.Get("/", index)
|
||||
app.Get("/:id", show)
|
||||
app.Get("/*", show)
|
||||
}
|
||||
Reference in new issue
Block a user