aboutsummaryrefslogtreecommitdiffhomepage
path: root/storage/entry.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/entry.go')
-rw-r--r--storage/entry.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/storage/entry.go b/storage/entry.go
index 5dfb801..151bf49 100644
--- a/storage/entry.go
+++ b/storage/entry.go
@@ -59,6 +59,23 @@ func (s *Storage) CreateEntry(entry *model.Entry) error {
return nil
}
+// UpdateEntryContent updates entry content.
+func (s *Storage) UpdateEntryContent(entry *model.Entry) error {
+ query := `
+ UPDATE entries SET
+ content=$1
+ WHERE user_id=$2 AND id=$3
+ `
+
+ _, err := s.db.Exec(
+ query,
+ entry.Content,
+ entry.UserID,
+ entry.ID,
+ )
+ return err
+}
+
// UpdateEntry update an entry when a feed is refreshed.
func (s *Storage) UpdateEntry(entry *model.Entry) error {
query := `