ListHooks retrieves all hooks of a specific type.
(c *gin.Context)
| 55 | |
| 56 | // ListHooks retrieves all hooks of a specific type. |
| 57 | func (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. |
| 69 | func (a *Api) DeleteHook(c *gin.Context) { |
nothing calls this directly
no test coverage detected