bulltrackers-module 1.0.466 → 1.0.467
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -592,15 +592,22 @@ async function publishWatchlistVersion(req, res, dependencies, config) {
|
|
|
592
592
|
name: watchlistData.name,
|
|
593
593
|
type: watchlistData.type,
|
|
594
594
|
description: watchlistData.dynamicConfig?.description || '',
|
|
595
|
-
// Snapshot the current state
|
|
596
|
-
items: watchlistData.items ? JSON.parse(JSON.stringify(watchlistData.items)) : undefined,
|
|
597
|
-
dynamicConfig: watchlistData.dynamicConfig ? JSON.parse(JSON.stringify(watchlistData.dynamicConfig)) : undefined,
|
|
598
595
|
snapshotAt: FieldValue.serverTimestamp(),
|
|
599
596
|
copyCount: 0,
|
|
600
597
|
createdAt: watchlistData.createdAt,
|
|
601
598
|
isImmutable: true // Public versions are immutable
|
|
602
599
|
};
|
|
603
600
|
|
|
601
|
+
// Only include items if it's a static watchlist
|
|
602
|
+
if (watchlistData.type === 'static' && watchlistData.items) {
|
|
603
|
+
versionData.items = JSON.parse(JSON.stringify(watchlistData.items));
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// Only include dynamicConfig if it's a dynamic watchlist
|
|
607
|
+
if (watchlistData.type === 'dynamic' && watchlistData.dynamicConfig) {
|
|
608
|
+
versionData.dynamicConfig = JSON.parse(JSON.stringify(watchlistData.dynamicConfig));
|
|
609
|
+
}
|
|
610
|
+
|
|
604
611
|
// Store version in versions subcollection
|
|
605
612
|
const versionRef = db.collection('public_watchlists')
|
|
606
613
|
.doc(id)
|