MM-15293: migrate commandstore.PermanentDeleteByUser to sync by default (#10744)

This commit is contained in:
Puneeth Reddy
2019-04-29 01:42:33 -07:00
committed by Miguel de la Cruz
parent 171058eb3d
commit dec3c8facb
5 changed files with 16 additions and 16 deletions

View File

@@ -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 {