diff --git a/internal/http/api_handlers.go b/internal/http/api_handlers.go index 9cafcc6..a921091 100644 --- a/internal/http/api_handlers.go +++ b/internal/http/api_handlers.go @@ -9,7 +9,6 @@ import ( "time" "git.arav.su/Arav/dwelling-home/pkg/mindflow" - "git.arav.su/Arav/dwelling-home/pkg/mindflow/database/sqlite" "git.arav.su/Arav/justcaptcha/pkg/captcha" "git.arav.su/Arav/justcaptcha/pkg/captcha/inmemdb" "git.arav.su/Arav/justcaptcha/pkg/dwcaptcha" @@ -214,10 +213,10 @@ func (h *CaptchaApiHandlers) Image(w http.ResponseWriter, r *http.Request) { // Mindflow API //////////////////////////////////////////////////////////////// type MindflowApiHandlers struct { - db *sqlite.SQLiteMindflow + db mindflow.Mindflow } -func NewMindflowApiHandlers(db *sqlite.SQLiteMindflow) *MindflowApiHandlers { +func NewMindflowApiHandlers(db mindflow.Mindflow) *MindflowApiHandlers { return &MindflowApiHandlers{db: db} } diff --git a/pkg/mindflow/database/sqlite/db.go b/pkg/mindflow/database/sqlite/db.go index 7fac033..b73f1be 100644 --- a/pkg/mindflow/database/sqlite/db.go +++ b/pkg/mindflow/database/sqlite/db.go @@ -82,7 +82,7 @@ type SQLiteMindflow struct { db *sql.DB } -func NewSQLiteMindflow(path string) (*SQLiteMindflow, error) { +func NewSQLiteMindflow(path string) (mindflow.Mindflow, error) { db, err := sql.Open("sqlite3", dsn(path)) if err != nil { return nil, err @@ -121,7 +121,7 @@ func (s *SQLiteMindflow) New(post *mindflow.Post) error { return nil } -func (s *SQLiteMindflow) Edit(post mindflow.Post) error { +func (s *SQLiteMindflow) Edit(post *mindflow.Post) error { tx, err := s.db.Begin() if err != nil { return err