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

Method MultiSearch

api/api.go:221–235  ·  view source on GitHub ↗

MultiSearch performs a multi-search query. It binds the incoming JSON request to a MultiSearchParameter object, executes the multi-search query, and responds with the search results. Parameters: - c: The Gin context containing the request and response. Responses: - 400 Bad Request: If there's an e

(c *gin.Context)

Source from the content-addressed store, hash-verified

219// - 400 Bad Request: If there's an error in binding JSON or performing the search.
220// - 200 OK: If the multi-search query is successfully executed and results are returned.
221func (a Api) MultiSearch(c *gin.Context) {
222 var searchRequests api.MultiSearchSearchesParameter
223 if err := c.BindJSON(&searchRequests); err != nil {
224 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
225 return
226 }
227
228 resp, err := a.ledgerforge.MultiSearch(&searchRequests)
229 if err != nil {
230 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
231 return
232 }
233
234 c.JSON(http.StatusOK, resp)
235}

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected