Add server-to-local configuration import in web UI

This commit is contained in:
Mikhail Chusavitin
2026-02-04 11:31:23 +03:00
parent 4509e93864
commit d094d39427
4 changed files with 125 additions and 3 deletions

View File

@@ -4,10 +4,10 @@ import (
"encoding/json"
"time"
"github.com/google/uuid"
"git.mchus.pro/mchus/quoteforge/internal/localdb"
"git.mchus.pro/mchus/quoteforge/internal/models"
"git.mchus.pro/mchus/quoteforge/internal/services/sync"
"github.com/google/uuid"
)
// LocalConfigurationService handles configurations in local-first mode
@@ -621,3 +621,8 @@ func (s *LocalConfigurationService) RefreshPricesNoAuth(uuid string) (*models.Co
return cfg, nil
}
// ImportFromServer imports configurations from MariaDB to local SQLite cache.
func (s *LocalConfigurationService) ImportFromServer() (*sync.ConfigImportResult, error) {
return s.syncService.ImportConfigurationsToLocal()
}