瀏覽代碼

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