GetAllBalanceMonitors retrieves all balance monitor records in the system. It fetches the monitor records and responds with the list of monitors. If there's an error retrieving the monitors, it responds with an appropriate error message. Parameters: - c: The Gin context containing the request and r
(c *gin.Context)
| 260 | // - 400 Bad Request: If there's an error retrieving the balance monitors. |
| 261 | // - 200 OK: If the balance monitors are successfully retrieved. |
| 262 | func (a Api) GetAllBalanceMonitors(c *gin.Context) { |
| 263 | monitors, err := a.ledgerforge.GetAllMonitors(c.Request.Context()) |
| 264 | if err != nil { |
| 265 | c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) |
| 266 | return |
| 267 | } |
| 268 | |
| 269 | c.JSON(http.StatusOK, monitors) |
| 270 | } |
| 271 | |
| 272 | // GetBalanceMonitorsByBalanceID retrieves all balance monitors associated with a specific balance ID. |
| 273 | // It extracts the balance ID from the route parameters. If the balance ID is missing |
nothing calls this directly
no test coverage detected