Compare commits
1 Commits
feature/ve
...
v1.3.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1906a74759 |
@@ -351,6 +351,15 @@ func (s *Service) SyncPricelists() (int, error) {
|
|||||||
// Check if pricelist already exists locally
|
// Check if pricelist already exists locally
|
||||||
existing, _ := s.localDB.GetLocalPricelistByServerID(pl.ID)
|
existing, _ := s.localDB.GetLocalPricelistByServerID(pl.ID)
|
||||||
if existing != nil {
|
if existing != nil {
|
||||||
|
// Backfill items for legacy/partial local caches where only pricelist metadata exists.
|
||||||
|
if s.localDB.CountLocalPricelistItems(existing.ID) == 0 {
|
||||||
|
itemCount, err := s.SyncPricelistItems(existing.ID)
|
||||||
|
if err != nil {
|
||||||
|
slog.Warn("failed to sync missing pricelist items for existing local pricelist", "version", pl.Version, "error", err)
|
||||||
|
} else {
|
||||||
|
slog.Info("synced missing pricelist items for existing local pricelist", "version", pl.Version, "items", itemCount)
|
||||||
|
}
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user