Better efficency for loading teams (#128)
Fix staticcheck Better performance for getting teams on a namespace Better performance for getting teams on a list Fix lint Fix swagger Signed-off-by: kolaente <k@knt.li> Make loading a single full team more efficent Signed-off-by: kolaente <k@knt.li> Make loading teams more efficent Signed-off-by: kolaente <k@knt.li> Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/128
This commit is contained in:
@ -186,6 +186,16 @@ func (tl *TeamList) ReadAll(a web.Auth, search string, page int, perPage int) (r
|
||||
return nil, 0, 0, err
|
||||
}
|
||||
|
||||
teams := []*Team{}
|
||||
for _, t := range all {
|
||||
teams = append(teams, &t.Team)
|
||||
}
|
||||
|
||||
err = addMoreInfoToTeams(teams)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
totalItems, err = x.
|
||||
Table("teams").
|
||||
Join("INNER", "team_list", "team_id = teams.id").
|
||||
|
Reference in New Issue
Block a user