1
0
Fork 0
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:
Frédéric Guillot 2023-10-06 22:42:59 -07:00
parent 7b541af253
commit e4285c2cba
10 changed files with 182 additions and 33 deletions

View file

@ -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
}
}