From 7872296b838f4d1b26c6a0a01d79d27fe5ab44cc Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 15 Apr 2023 21:07:16 +0200 Subject: Move asset store into its own package --- src/post/draft_post.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/post/draft_post.go') 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) } -- cgit v1.2.3