MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / GetAccount

Method GetAccount

api/accounts.go:71–82  ·  view source on GitHub ↗

GetAccount retrieves an account by its ID. It uses the provided account ID and optional query parameters to fetch the account. Parameters: - c: The Gin context containing the request and response. - id: The unique identifier of the account to retrieve. - includes: Optional query parameters to inclu

(c *gin.Context)

Source from the content-addressed store, hash-verified

69// - 400 Bad Request: If there's an error in fetching the account.
70// - 200 OK: If the account is successfully retrieved.
71func (a Api) GetAccount(c *gin.Context) {
72 id := c.Param("id")
73
74 includes := c.QueryArray("include")
75
76 account, err := a.ledgerforge.GetAccount(id, includes)
77 if err != nil {
78 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
79 return
80 }
81 c.JSON(http.StatusOK, account)
82}
83
84// GetAllAccounts retrieves all accounts.
85// It fetches a list of all accounts in the system.

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected