Commit 70ddf936 by Marcus Efraimsson

include teams on signed in user

parent 9edaa3fa
......@@ -165,6 +165,7 @@ type SignedInUser struct {
IsAnonymous bool
HelpFlags1 HelpFlags1
LastSeenAt time.Time
Teams []int64
}
func (u *SignedInUser) ShouldUpdateLastSeenAt() bool {
......
......@@ -387,6 +387,17 @@ func GetSignedInUser(query *m.GetSignedInUserQuery) error {
if user.OrgRole == "" {
user.OrgId = -1
user.OrgName = "Org missing"
} else {
getTeamsByUserQuery := &m.GetTeamsByUserQuery{OrgId: user.OrgId, UserId: user.UserId}
err = GetTeamsByUser(getTeamsByUserQuery)
if err != nil {
return err
}
user.Teams = make([]int64, len(getTeamsByUserQuery.Result))
for i, t := range getTeamsByUserQuery.Result {
user.Teams[i] = t.Id
}
}
query.Result = &user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment