MM-15293: migrate commandstore.PermanentDeleteByUser to sync by default (#10744)
Этот коммит содержится в:
коммит произвёл
Miguel de la Cruz
родитель
171058eb3d
Коммит
dec3c8facb
@@ -123,13 +123,13 @@ func (s SqlCommandStore) PermanentDeleteByTeam(teamId string) store.StoreChannel
|
||||
})
|
||||
}
|
||||
|
||||
func (s SqlCommandStore) PermanentDeleteByUser(userId string) store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
_, err := s.GetMaster().Exec("DELETE FROM Commands WHERE CreatorId = :UserId", map[string]interface{}{"UserId": userId})
|
||||
if err != nil {
|
||||
result.Err = model.NewAppError("SqlCommandStore.DeleteByUser", "store.sql_command.save.delete_perm.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
func (s SqlCommandStore) PermanentDeleteByUser(userId string) *model.AppError {
|
||||
_, err := s.GetMaster().Exec("DELETE FROM Commands WHERE CreatorId = :UserId", map[string]interface{}{"UserId": userId})
|
||||
if err != nil {
|
||||
return model.NewAppError("SqlCommandStore.DeleteByUser", "store.sql_command.save.delete_perm.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlCommandStore) Update(cmd *model.Command) store.StoreChannel {
|
||||
|
||||
Ссылка в новой задаче
Block a user