fix: handle includePublicBoards
This commit is contained in:
parent
33987d5c5b
commit
b7ead8a7e0
1 changed files with 10 additions and 2 deletions
|
@ -860,13 +860,21 @@ func (s *MattermostAuthLayer) GetBoardsForUserAndTeam(userID, teamID string, inc
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Handle the includePublicBoards
|
|
||||||
|
|
||||||
boardIDs := []string{}
|
boardIDs := []string{}
|
||||||
for _, m := range members {
|
for _, m := range members {
|
||||||
boardIDs = append(boardIDs, m.BoardID)
|
boardIDs = append(boardIDs, m.BoardID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if includePublicBoards {
|
||||||
|
boards, err := s.SearchBoardsForUserInTeam(teamID, "", userID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for _, b := range boards {
|
||||||
|
boardIDs = append(boardIDs, b.ID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boards, err := s.Store.GetBoardsInTeamByIds(boardIDs, teamID)
|
boards, err := s.Store.GetBoardsInTeamByIds(boardIDs, teamID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue