Skip to content

Commit b9c9f31

Browse files
authored
Merge pull request #63 from teknologi-umum/fix/backend/monitor-id-usage
fix(backend): Use monitor.UniqueID instead of monitorId in historical reader calls
2 parents a9876bd + f0c429a commit b9c9f31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/http.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func (s *Server) staticSnapshot(w http.ResponseWriter, r *http.Request) {
385385
var monitorHistorical []MonitorHistorical
386386
switch interval {
387387
case "raw":
388-
monitorHistorical, err = s.historicalReader.ReadRawHistorical(ctx, monitorId)
388+
monitorHistorical, err = s.historicalReader.ReadRawHistorical(ctx, monitor.UniqueID)
389389
if err != nil {
390390
w.Header().Set("Content-Type", "application/json")
391391
w.WriteHeader(http.StatusInternalServerError)
@@ -394,7 +394,7 @@ func (s *Server) staticSnapshot(w http.ResponseWriter, r *http.Request) {
394394
return
395395
}
396396
case "hourly":
397-
monitorHistorical, err = s.historicalReader.ReadHourlyHistorical(ctx, monitorId)
397+
monitorHistorical, err = s.historicalReader.ReadHourlyHistorical(ctx, monitor.UniqueID)
398398
if err != nil {
399399
w.Header().Set("Content-Type", "application/json")
400400
w.WriteHeader(http.StatusInternalServerError)
@@ -403,7 +403,7 @@ func (s *Server) staticSnapshot(w http.ResponseWriter, r *http.Request) {
403403
return
404404
}
405405
case "daily":
406-
monitorHistorical, err = s.historicalReader.ReadDailyHistorical(ctx, monitorId)
406+
monitorHistorical, err = s.historicalReader.ReadDailyHistorical(ctx, monitor.UniqueID)
407407
if err != nil {
408408
w.Header().Set("Content-Type", "application/json")
409409
w.WriteHeader(http.StatusInternalServerError)

0 commit comments

Comments
 (0)