mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
update OSversion service method to not search on for no team
(#13127)
relates to #12986 This is a fix for a case where the `os_versions` endpoint was returning a 404 when searching for `no teams`. # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Manual QA for all new/changed functionality
This commit is contained in:
parent
37ba43d404
commit
b4ee1c58b5
1
changes/issue-12986-fix-no-teams-error
Normal file
1
changes/issue-12986-fix-no-teams-error
Normal file
@ -0,0 +1 @@
|
||||
- fix bug where os_version enpoint returned 404 for `no teams` on controls page
|
@ -1496,7 +1496,7 @@ func (svc *Service) OSVersions(ctx context.Context, teamID *uint, platform *stri
|
||||
osVersions, err := svc.ds.OSVersions(ctx, teamID, platform, name, version)
|
||||
if err != nil && fleet.IsNotFound(err) {
|
||||
// differentiate case where team was added after UpdateOSVersions last ran
|
||||
if teamID != nil {
|
||||
if teamID != nil && *teamID > 0 {
|
||||
// most of the time, team should exist so checking here saves unnecessary db calls
|
||||
_, err := svc.ds.Team(ctx, *teamID)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user