GetHook retrieves a specific webhook by ID.
(c *gin.Context)
| 43 | |
| 44 | // GetHook retrieves a specific webhook by ID. |
| 45 | func (a *Api) GetHook(c *gin.Context) { |
| 46 | hookID := c.Param("id") |
| 47 | hook, err := a.ledgerforge.Hooks.GetHook(c.Request.Context(), hookID) |
| 48 | if err != nil { |
| 49 | c.JSON(http.StatusNotFound, apierror.NewAPIError(apierror.ErrNotFound, "hook not found", err)) |
| 50 | return |
| 51 | } |
| 52 | |
| 53 | c.JSON(http.StatusOK, hook) |
| 54 | } |
| 55 | |
| 56 | // ListHooks retrieves all hooks of a specific type. |
| 57 | func (a *Api) ListHooks(c *gin.Context) { |
nothing calls this directly
no test coverage detected