From f602dddff32b14bb3e96e7f8ff8d9d9f545a6ea5 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 6 May 2023 22:18:20 +0400 Subject: [PATCH] Replaced Update*() with Edit*(). --- database/sqlite/database.go | 5 ++--- guestbook/database.go | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/database/sqlite/database.go b/database/sqlite/database.go index 2e4cc70..ee0c551 100644 --- a/database/sqlite/database.go +++ b/database/sqlite/database.go @@ -205,8 +205,7 @@ func (d *SQLiteDatabase) NewEntry(entry *guestbook.Entry) error { return nil } -// UpdateEntry -func (d *SQLiteDatabase) UpdateEntry(entry *guestbook.Entry) error { +func (d *SQLiteDatabase) EditEntry(entry *guestbook.Entry) error { tx, err := d.db.Begin() if err != nil { return err @@ -261,7 +260,7 @@ func (d *SQLiteDatabase) NewReply(reply *guestbook.Reply) error { return nil } -func (d *SQLiteDatabase) UpdateReply(reply *guestbook.Reply) error { +func (d *SQLiteDatabase) EditReply(reply *guestbook.Reply) error { tx, err := d.db.Begin() if err != nil { return err diff --git a/guestbook/database.go b/guestbook/database.go index 505f5a7..92e4110 100644 --- a/guestbook/database.go +++ b/guestbook/database.go @@ -6,10 +6,10 @@ type Guestbook interface { Entries(page, pageSize int64) ([]*Entry, error) Count() (int64, error) NewEntry(entry *Entry) error - UpdateEntry(entry *Entry) error - DeleteEntry(entryID int64) (int64, error) + EditEntry(entry *Entry) error + DeleteEntry(entryID int64) error NewReply(reply *Reply) error - UpdateReply(reply *Reply) error - DeleteReply(entryID int64) (int64, error) + EditReply(reply *Reply) error + DeleteReply(entryID int64) error Close() error }