feat(bookstack-api-d2c): implement Pages Create and Update
Add PageCreateRequest and PageUpdateRequest types. Implement Create() and Update() on PagesService with proper error handling. Add tests including bad request validation.
This commit is contained in:
parent
13a952355e
commit
970699afe2
5 changed files with 111 additions and 5 deletions
16
types.go
16
types.go
|
|
@ -63,6 +63,22 @@ type Shelf struct {
|
|||
OwnedBy int `json:"owned_by"`
|
||||
}
|
||||
|
||||
// PageCreateRequest contains fields for creating a new page.
|
||||
type PageCreateRequest struct {
|
||||
BookID int `json:"book_id"`
|
||||
ChapterID int `json:"chapter_id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
HTML string `json:"html,omitempty"`
|
||||
Markdown string `json:"markdown,omitempty"`
|
||||
}
|
||||
|
||||
// PageUpdateRequest contains fields for updating an existing page.
|
||||
type PageUpdateRequest struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
HTML string `json:"html,omitempty"`
|
||||
Markdown string `json:"markdown,omitempty"`
|
||||
}
|
||||
|
||||
// SearchResult represents a search result from Bookstack.
|
||||
type SearchResult struct {
|
||||
Type string `json:"type"` // "page", "chapter", "book", or "shelf"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue