Changeset 0.37.14 (#226)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
@@ -46,7 +46,7 @@ func (h *ChannelModelHandler) List(c *gin.Context) {
|
||||
if roster == nil {
|
||||
roster = []models.ChannelModel{}
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"models": roster})
|
||||
c.JSON(http.StatusOK, gin.H{"data": roster})
|
||||
}
|
||||
|
||||
// ── Add ──────────────────────────────────────
|
||||
@@ -110,7 +110,7 @@ func (h *ChannelModelHandler) Add(c *gin.Context) {
|
||||
// Return the updated roster
|
||||
roster, _ := h.stores.Channels.GetModels(c.Request.Context(), channelID)
|
||||
if roster == nil { roster = []models.ChannelModel{} }
|
||||
c.JSON(http.StatusCreated, gin.H{"models": roster})
|
||||
c.JSON(http.StatusCreated, gin.H{"data": roster})
|
||||
}
|
||||
|
||||
// ── Update ───────────────────────────────────
|
||||
@@ -177,7 +177,7 @@ func (h *ChannelModelHandler) Update(c *gin.Context) {
|
||||
|
||||
roster, _ := h.stores.Channels.GetModels(c.Request.Context(), channelID)
|
||||
if roster == nil { roster = []models.ChannelModel{} }
|
||||
c.JSON(http.StatusOK, gin.H{"models": roster})
|
||||
c.JSON(http.StatusOK, gin.H{"data": roster})
|
||||
}
|
||||
|
||||
// ── Delete ───────────────────────────────────
|
||||
@@ -222,7 +222,7 @@ func (h *ChannelModelHandler) Delete(c *gin.Context) {
|
||||
|
||||
roster, _ := h.stores.Channels.GetModels(c.Request.Context(), channelID)
|
||||
if roster == nil { roster = []models.ChannelModel{} }
|
||||
c.JSON(http.StatusOK, gin.H{"models": roster})
|
||||
c.JSON(http.StatusOK, gin.H{"data": roster})
|
||||
}
|
||||
|
||||
// ── Helpers ──────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user