Fix mini-slider admin CRUD JSON encoding and drop seed data from the migration.

Encode title as JSON text so create/list work with pgx, and keep the table migration permission-free so rows are added from admin.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 19:04:48 +05:00
parent 82b1e903f6
commit 262292651a
7 changed files with 74 additions and 73 deletions

View File

@@ -54,6 +54,7 @@ func (h *handler) Register(router *gin.RouterGroup) {
func (h *handler) GetAll(c *gin.Context) {
result, err := h.repository.GetAllData(context.Background(), listing.FromQuery(c))
if err != nil {
h.logger.Error("get all mini slider :::", err)
c.JSON(http.StatusInternalServerError, appresult.ErrInternalServer)
return
}
@@ -107,6 +108,7 @@ func (h *handler) Create(c *gin.Context) {
res, err := h.repository.AddData(context.Background(), reqDTO)
if err != nil {
h.logger.Error("create mini slider :::", err)
c.JSON(http.StatusInternalServerError, appresult.ErrInternalServer)
return
}
@@ -141,6 +143,7 @@ func (h *handler) Update(c *gin.Context) {
res, err := h.repository.UpdateData(context.Background(), reqDTO, id)
if err != nil {
h.logger.Error("update mini slider :::", err)
c.JSON(http.StatusInternalServerError, appresult.ErrInternalServer)
return
}