mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
[REFACTOR] webhook msteams endpoint
This commit is contained in:
parent
46b71ec709
commit
97f0ad49ff
4 changed files with 15 additions and 36 deletions
|
@ -388,27 +388,6 @@ func gogsHookParams(ctx *context.Context) webhookParams {
|
|||
}
|
||||
}
|
||||
|
||||
// MSTeamsHooksNewPost response for creating MSTeams webhook
|
||||
func MSTeamsHooksNewPost(ctx *context.Context) {
|
||||
createWebhook(ctx, mSTeamsHookParams(ctx))
|
||||
}
|
||||
|
||||
// MSTeamsHooksEditPost response for editing MSTeams webhook
|
||||
func MSTeamsHooksEditPost(ctx *context.Context) {
|
||||
editWebhook(ctx, mSTeamsHookParams(ctx))
|
||||
}
|
||||
|
||||
func mSTeamsHookParams(ctx *context.Context) webhookParams {
|
||||
form := web.GetForm(ctx).(*forms.NewMSTeamsHookForm)
|
||||
|
||||
return webhookParams{
|
||||
Type: webhook_module.MSTEAMS,
|
||||
URL: form.PayloadURL,
|
||||
ContentType: webhook.ContentTypeJSON,
|
||||
WebhookForm: form.WebhookForm,
|
||||
}
|
||||
}
|
||||
|
||||
// FeishuHooksNewPost response for creating Feishu webhook
|
||||
func FeishuHooksNewPost(ctx *context.Context) {
|
||||
createWebhook(ctx, feishuHookParams(ctx))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue