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

Method ListHooks

api/hooks.go:57–66  ·  view source on GitHub ↗

ListHooks retrieves all hooks of a specific type.

(c *gin.Context)

Source from the content-addressed store, hash-verified

55
56// ListHooks retrieves all hooks of a specific type.
57func (a *Api) ListHooks(c *gin.Context) {
58 hookType := hooks.HookType(c.Query("type"))
59 hooks, err := a.ledgerforge.Hooks.ListHooks(c.Request.Context(), hookType)
60 if err != nil {
61 c.JSON(http.StatusBadRequest, apierror.NewAPIError(apierror.ErrInvalidInput, "failed to list hooks", err))
62 return
63 }
64
65 c.JSON(http.StatusOK, hooks)
66}
67
68// DeleteHook removes a webhook by ID.
69func (a *Api) DeleteHook(c *gin.Context) {

Callers

nothing calls this directly

Calls 3

HookTypeTypeAlias · 0.92
NewAPIErrorFunction · 0.92
ListHooksMethod · 0.65

Tested by

no test coverage detected