MM-26057 - Add CreateCommand plugin API (#14916)

Automatic Merge
Этот коммит содержится в:
Christopher Poile
2020-07-31 11:40:15 -04:00
коммит произвёл GitHub
родитель 61cc7a8680
Коммит c5c6a5ce53
11 изменённых файлов: 763 добавлений и 18 удалений

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

@@ -603,6 +603,10 @@ func (a *App) CreateCommand(cmd *model.Command) (*model.Command, *model.AppError
return nil, model.NewAppError("CreateCommand", "api.command.disabled.app_error", nil, "", http.StatusNotImplemented)
}
return a.createCommand(cmd)
}
func (a *App) createCommand(cmd *model.Command) (*model.Command, *model.AppError) {
cmd.Trigger = strings.ToLower(cmd.Trigger)
teamCmds, err := a.Srv().Store.Command().GetByTeam(cmd.TeamId)
@@ -667,6 +671,7 @@ func (a *App) UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command,
updatedCmd.UpdateAt = model.GetMillis()
updatedCmd.DeleteAt = oldCmd.DeleteAt
updatedCmd.CreatorId = oldCmd.CreatorId
updatedCmd.PluginId = oldCmd.PluginId
updatedCmd.TeamId = oldCmd.TeamId
command, err := a.Srv().Store.Command().Update(updatedCmd)