Use request.CTX instead of *request.Context (#24877)

* Use request.CTX instead of *request.Context

* Fix tests
Этот коммит содержится в:
Ben Schumacher
2023-10-30 16:33:37 +01:00
коммит произвёл GitHub
родитель 37dc35c1a1
Коммит c7461751f2
106 изменённых файлов: 612 добавлений и 613 удалений

Просмотреть файл

@@ -657,7 +657,7 @@ func (a *App) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.Out
return webhook, nil
}
func (a *App) HandleIncomingWebhook(c *request.Context, hookID string, req *model.IncomingWebhookRequest) *model.AppError {
func (a *App) HandleIncomingWebhook(c request.CTX, hookID string, req *model.IncomingWebhookRequest) *model.AppError {
if !*a.Config().ServiceSettings.EnableIncomingWebhooks {
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
}
@@ -817,7 +817,7 @@ func (a *App) CreateCommandWebhook(commandID string, args *model.CommandArgs) (*
return savedHook, nil
}
func (a *App) HandleCommandWebhook(c *request.Context, hookID string, response *model.CommandResponse) *model.AppError {
func (a *App) HandleCommandWebhook(c request.CTX, hookID string, response *model.CommandResponse) *model.AppError {
if response == nil {
return model.NewAppError("HandleCommandWebhook", "app.command_webhook.handle_command_webhook.parse", nil, "", http.StatusBadRequest)
}