fix(db): add the room in the returned json
Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
@@ -365,7 +365,9 @@ func (g *RestGateway) getRoomCurrent(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if it.Next() {
|
if it.Next() {
|
||||||
c.JSON(http.StatusOK, it.Value())
|
val := it.Value()
|
||||||
|
val["room"] = roomID
|
||||||
|
c.JSON(http.StatusOK, val)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,7 +426,9 @@ func (g *RestGateway) getRoomHistory(c *gin.Context) {
|
|||||||
|
|
||||||
var history []map[string]any
|
var history []map[string]any
|
||||||
for it.Next() {
|
for it.Next() {
|
||||||
history = append(history, it.Value())
|
val := it.Value()
|
||||||
|
val["room"] = roomID
|
||||||
|
history = append(history, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := it.Err(); err != nil {
|
if err := it.Err(); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user