Embed assets and fix offline/sync/pricing issues

This commit is contained in:
2026-02-03 21:58:02 +03:00
parent 8d84484412
commit 20056f3593
9 changed files with 170 additions and 67 deletions

View File

@@ -4,10 +4,10 @@ import (
"net/http"
"strconv"
"github.com/gin-gonic/gin"
"git.mchus.pro/mchus/quoteforge/internal/localdb"
"git.mchus.pro/mchus/quoteforge/internal/repository"
"git.mchus.pro/mchus/quoteforge/internal/services"
"github.com/gin-gonic/gin"
)
type ComponentHandler struct {
@@ -40,7 +40,13 @@ func (h *ComponentHandler) List(c *gin.Context) {
}
// If offline mode (empty result), fallback to local components
if result.Total == 0 && h.localDB != nil {
isOffline := false
if v, ok := c.Get("is_offline"); ok {
if b, ok := v.(bool); ok {
isOffline = b
}
}
if isOffline && result.Total == 0 && h.localDB != nil {
localFilter := localdb.ComponentFilter{
Category: filter.Category,
Search: filter.Search,