summaryrefslogtreecommitdiffstats
path: root/store/sqlstore/team_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sqlstore/team_store.go')
-rw-r--r--store/sqlstore/team_store.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/store/sqlstore/team_store.go b/store/sqlstore/team_store.go
index cddfb7c1a..6528b8e4c 100644
--- a/store/sqlstore/team_store.go
+++ b/store/sqlstore/team_store.go
@@ -99,6 +99,7 @@ func (s SqlTeamStore) Update(team *model.Team) store.StoreChannel {
team.CreateAt = oldTeam.CreateAt
team.UpdateAt = model.GetMillis()
team.Name = oldTeam.Name
+ team.LastTeamIconUpdate = oldTeam.LastTeamIconUpdate
if count, err := s.GetMaster().Update(team); err != nil {
result.Err = model.NewAppError("SqlTeamStore.Update", "store.sql_team.update.updating.app_error", nil, "id="+team.Id+", "+err.Error(), http.StatusInternalServerError)
@@ -559,3 +560,13 @@ func (s SqlTeamStore) RemoveAllMembersByUser(userId string) store.StoreChannel {
}
})
}
+
+func (us SqlTeamStore) UpdateLastTeamIconUpdate(teamId string, curTime int64) store.StoreChannel {
+ return store.Do(func(result *store.StoreResult) {
+ if _, err := us.GetMaster().Exec("UPDATE Teams SET LastTeamIconUpdate = :Time, UpdateAt = :Time WHERE Id = :teamId", map[string]interface{}{"Time": curTime, "teamId": teamId}); err != nil {
+ result.Err = model.NewAppError("SqlTeamStore.UpdateLastTeamIconUpdate", "store.sql_team.update_last_team_icon_update.app_error", nil, "team_id="+teamId, http.StatusInternalServerError)
+ } else {
+ result.Data = teamId
+ }
+ })
+}