feat(bookstack-api-9at): implement Pages Delete
Add Delete() to PagesService with tests for success, 404, and 403.
This commit is contained in:
parent
970699afe2
commit
04cf1565fa
4 changed files with 55 additions and 5 deletions
5
pages.go
5
pages.go
|
|
@ -56,6 +56,11 @@ func (s *PagesService) Update(ctx context.Context, id int, req *PageUpdateReques
|
|||
return &page, nil
|
||||
}
|
||||
|
||||
// Delete deletes a page by ID.
|
||||
func (s *PagesService) Delete(ctx context.Context, id int) error {
|
||||
return s.client.do(ctx, "DELETE", fmt.Sprintf("/api/pages/%d", id), nil, nil)
|
||||
}
|
||||
|
||||
// ExportMarkdown exports a page as markdown.
|
||||
func (s *PagesService) ExportMarkdown(ctx context.Context, id int) ([]byte, error) {
|
||||
return s.client.doRaw(ctx, "GET", fmt.Sprintf("/api/pages/%d/export/markdown", id))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue