diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2023-04-15 21:07:16 +0200 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2023-04-15 21:07:16 +0200 |
commit | 7872296b838f4d1b26c6a0a01d79d27fe5ab44cc (patch) | |
tree | 9487f5abb93d88ab3b52700d2b3002b7dda373d6 /src/post/draft_post.go | |
parent | 68f3215df6e2e4f345076dd5b20b9bf5867353cf (diff) |
Move asset store into its own package
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) } |