fix: handle includePublicBoards

This commit is contained in:
Paul Esch-Laurent 2022-08-29 14:54:03 -05:00
parent 33987d5c5b
commit b7ead8a7e0

View file

@ -860,13 +860,21 @@ func (s *MattermostAuthLayer) GetBoardsForUserAndTeam(userID, teamID string, inc
return nil, err
}
// TODO: Handle the includePublicBoards
boardIDs := []string{}
for _, m := range members {
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)
if err != nil {
return nil, err