MM-15294: migrate commandstore.Update to sync by default (#10745)
* MM-15294: migrate commandstore.Update to sync by default * minor change for code consistency
Этот коммит содержится в:
@@ -502,19 +502,15 @@ func (a *App) UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command,
|
||||
updatedCmd.CreatorId = oldCmd.CreatorId
|
||||
updatedCmd.TeamId = oldCmd.TeamId
|
||||
|
||||
result := <-a.Srv.Store.Command().Update(updatedCmd)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
return result.Data.(*model.Command), nil
|
||||
return a.Srv.Store.Command().Update(updatedCmd)
|
||||
}
|
||||
|
||||
func (a *App) MoveCommand(team *model.Team, command *model.Command) *model.AppError {
|
||||
command.TeamId = team.Id
|
||||
|
||||
result := <-a.Srv.Store.Command().Update(command)
|
||||
if result.Err != nil {
|
||||
return result.Err
|
||||
_, err := a.Srv.Store.Command().Update(command)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -527,12 +523,7 @@ func (a *App) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppE
|
||||
|
||||
cmd.Token = model.NewId()
|
||||
|
||||
result := <-a.Srv.Store.Command().Update(cmd)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
|
||||
return result.Data.(*model.Command), nil
|
||||
return a.Srv.Store.Command().Update(cmd)
|
||||
}
|
||||
|
||||
func (a *App) DeleteCommand(commandId string) *model.AppError {
|
||||
|
||||
Ссылка в новой задаче
Block a user