|
|
|
@ -71,7 +71,15 @@ func PostApiUpdate(c *fiber.Ctx) error { |
|
|
|
|
return c.RedirectBack("/admin/table/", 303) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func PutApiInsert(c *fiber.Ctx) error { |
|
|
|
|
func GetPageInsert(c *fiber.Ctx) error { |
|
|
|
|
table := c.Params("table") |
|
|
|
|
|
|
|
|
|
// NOTE: need to get a blank json for the table schema and use that to populate the template OR have a simple get that does it. Probably the former.
|
|
|
|
|
|
|
|
|
|
return c.Render("admin/table/new", fiber.Map{ "Table": table }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func PostApiInsert(c *fiber.Ctx) error { |
|
|
|
|
return c.JSON(fiber.Map{}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -93,10 +101,13 @@ func Setup(app *fiber.App) { |
|
|
|
|
app.Get("/api/admin/table/:table/", GetApiSelectAll) |
|
|
|
|
app.Get("/admin/table/:table/", GetPageSelectAll) |
|
|
|
|
|
|
|
|
|
app.Get("/admin/new/table/:table/", GetPageInsert) |
|
|
|
|
app.Post("/api/admin/new/table/:table/", PostApiInsert) |
|
|
|
|
|
|
|
|
|
app.Get("/api/admin/table/:table/:id/", GetApiSelectOne) |
|
|
|
|
app.Get("/admin/table/:table/:id/", GetPageSelectOne) |
|
|
|
|
|
|
|
|
|
app.Post("/api/admin/table/:table/:id/", PostApiUpdate) |
|
|
|
|
app.Put("/api/admin/table/:table/:id/", PutApiInsert) |
|
|
|
|
|
|
|
|
|
app.Delete("/api/admin/table/:table/:id/", DeleteApi) |
|
|
|
|
} |
|
|
|
|