Skip to content

Commit

Permalink
vapi: support DeleteLibrary with subscribed libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
dougm committed Sep 26, 2019
1 parent 2cc33fa commit 234aaf5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vapi/library/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ func (c *Manager) CreateLibrary(ctx context.Context, library Library) (string, e

// DeleteLibrary deletes an existing library.
func (c *Manager) DeleteLibrary(ctx context.Context, library *Library) error {
url := c.Resource(internal.LocalLibraryPath).WithID(library.ID)
path := internal.LocalLibraryPath
if library.Type == "SUBSCRIBED" {
path = internal.SubscribedLibraryPath
}
url := c.Resource(path).WithID(library.ID)
return c.Do(ctx, url.Request(http.MethodDelete), nil)
}

Expand Down

0 comments on commit 234aaf5

Please sign in to comment.