Changeset 0.28.0.5 (#177)
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, roster)
|
||||
c.JSON(http.StatusOK, gin.H{"models": roster})
|
||||
}
|
||||
|
||||
// ── Add ──────────────────────────────────────
|
||||
@@ -109,6 +109,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})
|
||||
}
|
||||
|
||||
@@ -175,6 +176,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})
|
||||
}
|
||||
|
||||
@@ -219,6 +221,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})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user