Skip to content

Commit

Permalink
Get by ID, for older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne committed Nov 8, 2023
1 parent 00e8f46 commit 72c5c80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/resources/grafana/common_check_exists_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ var (
},
)
playlistCheckExists = newCheckExistsHelper(
func(p *models.Playlist) string { return p.UID },
func(p *models.Playlist) string {
if p.UID == "" {
return strconv.FormatInt(p.ID, 10)
}
return p.UID
},
func(client *goapi.GrafanaHTTPAPI, id string) (*models.Playlist, error) {
params := playlists.NewGetPlaylistParams().WithUID(id)
resp, err := client.Playlists.GetPlaylist(params, nil)
Expand Down

0 comments on commit 72c5c80

Please sign in to comment.