fix(db): return window tag in room status
Breakchange in Influx, it's now window_open. Change this tag in the returned json to previous tag "window" to avoir a breaking change Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
@@ -382,6 +382,8 @@ func (g *RestGateway) getRoomCurrent(c *gin.Context) {
|
||||
if it.Next() {
|
||||
val := it.Value()
|
||||
val["room"] = roomID
|
||||
val["window"] = val["window_open"]
|
||||
delete(val, "window_open")
|
||||
if t, ok := val["time"]; ok {
|
||||
val["time"] = formatTime(t)
|
||||
}
|
||||
@@ -446,6 +448,8 @@ func (g *RestGateway) getRoomHistory(c *gin.Context) {
|
||||
for it.Next() {
|
||||
val := it.Value()
|
||||
val["room"] = roomID
|
||||
val["window"] = val["window_open"]
|
||||
delete(val, "window_open")
|
||||
if t, ok := val["time"]; ok {
|
||||
val["time"] = formatTime(t)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user