mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Add API endpoint to update entry title and content
This commit is contained in:
parent
7b541af253
commit
e4285c2cba
10 changed files with 182 additions and 33 deletions
|
@ -58,3 +58,19 @@ type EntriesStatusUpdateRequest struct {
|
|||
EntryIDs []int64 `json:"entry_ids"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
// EntryUpdateRequest represents a request to update an entry.
|
||||
type EntryUpdateRequest struct {
|
||||
Title *string `json:"title"`
|
||||
Content *string `json:"content"`
|
||||
}
|
||||
|
||||
func (e *EntryUpdateRequest) Patch(entry *Entry) {
|
||||
if e.Title != nil && *e.Title != "" {
|
||||
entry.Title = *e.Title
|
||||
}
|
||||
|
||||
if e.Content != nil && *e.Content != "" {
|
||||
entry.Content = *e.Content
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue