Переглянути джерело

gotta clean up how the assets and navbar items are stored

aeth 2 місяців тому
батько
коміт
3d5f4ccd4a
2 змінених файлів з 6 додано та 1 видалено
  1. 1 1
      cmd/seed/seed.go
  2. 5 0
      pkg/helpers/storage.go

+ 1 - 1
cmd/seed/seed.go

@@ -15,7 +15,7 @@ import (
 	_ "github.com/mattn/go-sqlite3"
 )
 
-const DEFAULT_URL = "http://localhost:8080"
+const DEFAULT_URL = "http://localhost:10277"
 
 // authenticate and get the cookie needed to make updates
 func auth() string {

+ 5 - 0
pkg/helpers/storage.go

@@ -512,6 +512,11 @@ func (s *SQLiteRepo) AddNavbarItem(item NavBarItem) error {
 		tx.Rollback()
 		return err
 	}
+	err = s.AddAsset(item.Link, item.Png)
+	if err != nil {
+		tx.Rollback()
+		return err
+	}
 	tx.Commit()
 	return nil