Files
sablier/internal/api/theme_list.go
Alexis Couvreur 00cc153d7a fix: add http error responses (#494)
This features adds rfc7807 Problem detail responses when an error happens processing a request.

This will greatly improve the common issues  with "blank pages" and "404 pages" issues which should now properly tell the user what input was wrong (group that does not exist, container name that does not exist, etc.)
2025-02-02 00:00:49 -05:00

19 lines
392 B
Go

package api
import (
"github.com/gin-gonic/gin"
"github.com/sablierapp/sablier/app/http/routes"
"net/http"
)
func ListThemes(router *gin.RouterGroup, s *routes.ServeStrategy) {
handler := func(c *gin.Context) {
c.JSON(http.StatusOK, map[string]interface{}{
"themes": s.Theme.List(),
})
}
router.GET("/themes", handler)
router.GET("/dynamic/themes", handler) // Legacy path
}