DeleteHook removes a webhook by ID.
(c *gin.Context)
| 67 | |
| 68 | // DeleteHook removes a webhook by ID. |
| 69 | func (a *Api) DeleteHook(c *gin.Context) { |
| 70 | hookID := c.Param("id") |
| 71 | if err := a.ledgerforge.Hooks.DeleteHook(c.Request.Context(), hookID); err != nil { |
| 72 | c.JSON(http.StatusBadRequest, apierror.NewAPIError(apierror.ErrInvalidInput, "failed to delete hook", err)) |
| 73 | return |
| 74 | } |
| 75 | |
| 76 | c.JSON(http.StatusOK, gin.H{"message": "hook deleted successfully"}) |
| 77 | } |
nothing calls this directly
no test coverage detected