diff options
Diffstat (limited to 'src/post/draft_post.go')
-rw-r--r-- | src/post/draft_post.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/post/draft_post.go b/src/post/draft_post.go index 1c0e075..0576258 100644 --- a/src/post/draft_post.go +++ b/src/post/draft_post.go @@ -47,7 +47,7 @@ func (s *draftStore) Set(post Post) error { return fmt.Errorf("json marshaling tags %#v: %w", post.Tags, err) } - _, err = s.db.db.Exec( + _, err = s.db.Exec( `INSERT INTO post_drafts ( id, title, description, tags, series, body, format ) @@ -145,7 +145,7 @@ func (s *draftStore) get( func (s *draftStore) Get(page, count int) ([]Post, bool, error) { - posts, err := s.get(s.db.db, count+1, page*count, ``) + posts, err := s.get(s.db, count+1, page*count, ``) if err != nil { return nil, false, fmt.Errorf("querying post_drafts: %w", err) @@ -163,7 +163,7 @@ func (s *draftStore) Get(page, count int) ([]Post, bool, error) { func (s *draftStore) GetByID(id string) (Post, error) { - posts, err := s.get(s.db.db, 0, 0, `WHERE p.id=?`, id) + posts, err := s.get(s.db, 0, 0, `WHERE p.id=?`, id) if err != nil { return Post{}, fmt.Errorf("querying post_drafts: %w", err) @@ -182,7 +182,7 @@ func (s *draftStore) GetByID(id string) (Post, error) { func (s *draftStore) Delete(id string) error { - if _, err := s.db.db.Exec(`DELETE FROM post_drafts WHERE id = ?`, id); err != nil { + if _, err := s.db.Exec(`DELETE FROM post_drafts WHERE id = ?`, id); err != nil { return fmt.Errorf("deleting from post_drafts: %w", err) } |