WebhookStore migration (#15042)
* Migration completed * Fix tests Co-authored-by: Jesús Espino <jespinog@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ed3c93716d
Коммит
1c5b6522e3
@@ -1128,13 +1128,13 @@ func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppErr
|
||||
|
||||
go func() {
|
||||
webhooks, err := a.Srv().Store.Webhook().GetIncomingByChannel(channel.Id)
|
||||
ihc <- store.StoreResult{Data: webhooks, Err: err}
|
||||
ihc <- store.StoreResult{Data: webhooks, NErr: err}
|
||||
close(ihc)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
outgoingHooks, err := a.Srv().Store.Webhook().GetOutgoingByChannel(channel.Id, -1, -1)
|
||||
ohc <- store.StoreResult{Data: outgoingHooks, Err: err}
|
||||
ohc <- store.StoreResult{Data: outgoingHooks, NErr: err}
|
||||
close(ohc)
|
||||
}()
|
||||
|
||||
@@ -1148,13 +1148,13 @@ func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppErr
|
||||
}
|
||||
|
||||
ihcresult := <-ihc
|
||||
if ihcresult.Err != nil {
|
||||
return ihcresult.Err
|
||||
if ihcresult.NErr != nil {
|
||||
return model.NewAppError("DeleteChannel", "app.webhooks.get_incoming_by_channel.app_error", nil, ihcresult.NErr.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
ohcresult := <-ohc
|
||||
if ohcresult.Err != nil {
|
||||
return ohcresult.Err
|
||||
if ohcresult.NErr != nil {
|
||||
return model.NewAppError("DeleteChannel", "app.webhooks.get_outgoing_by_channel.app_error", nil, ohcresult.NErr.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
incomingHooks := ihcresult.Data.([]*model.IncomingWebhook)
|
||||
@@ -2340,11 +2340,11 @@ func (a *App) PermanentDeleteChannel(channel *model.Channel) *model.AppError {
|
||||
}
|
||||
|
||||
if err := a.Srv().Store.Webhook().PermanentDeleteIncomingByChannel(channel.Id); err != nil {
|
||||
return err
|
||||
return model.NewAppError("PermanentDeleteChannel", "app.webhooks.permanent_delete_incoming_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
if err := a.Srv().Store.Webhook().PermanentDeleteOutgoingByChannel(channel.Id); err != nil {
|
||||
return err
|
||||
return model.NewAppError("PermanentDeleteChannel", "app.webhooks.permanent_delete_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
if nErr := a.Srv().Store.Channel().PermanentDelete(channel.Id); nErr != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user