(c *gin.Context)
| 501 | } |
| 502 | |
| 503 | func (a Api) GetBalanceLineage(c *gin.Context) { |
| 504 | id, passed := c.Params.Get("id") |
| 505 | if !passed { |
| 506 | c.JSON(http.StatusBadRequest, gin.H{"error": "id is required. pass id in the route /:id"}) |
| 507 | return |
| 508 | } |
| 509 | |
| 510 | lineage, err := a.ledgerforge.GetBalanceLineage(c.Request.Context(), id) |
| 511 | if err != nil { |
| 512 | c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) |
| 513 | return |
| 514 | } |
| 515 | |
| 516 | c.JSON(http.StatusOK, lineage) |
| 517 | } |