getWebhook uses argument bean as query condition, ID must be specified and do not assign unnecessary fields.
(bean *Webhook)
| 258 | // getWebhook uses argument bean as query condition, |
| 259 | // ID must be specified and do not assign unnecessary fields. |
| 260 | func getWebhook(bean *Webhook) (*Webhook, error) { |
| 261 | has, err := x.Get(bean) |
| 262 | if err != nil { |
| 263 | return nil, err |
| 264 | } else if !has { |
| 265 | return nil, ErrWebhookNotExist{args: map[string]any{"webhookID": bean.ID}} |
| 266 | } |
| 267 | return bean, nil |
| 268 | } |
| 269 | |
| 270 | // GetWebhookByID returns webhook by given ID. |
| 271 | // Use this function with caution of accessing unauthorized webhook, |
no test coverage detected