bulltrackers-module 1.0.676 → 1.0.677

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.
@@ -2061,7 +2061,12 @@ const fetchTrendingPopularInvestors = async (db) => {
2061
2061
  console.log(`[Trending] Got result for ${dateKey}:`, JSON.stringify(result).substring(0, 500));
2062
2062
  // If we got a result, return it (even if trending array is empty)
2063
2063
  if (result) {
2064
- const trending = result.trending || [];
2064
+ // Handle case where data is wrapped under "undefined" key
2065
+ let trending = result.trending;
2066
+ if (!trending && result.undefined && result.undefined.trending) {
2067
+ trending = result.undefined.trending;
2068
+ }
2069
+ trending = trending || [];
2065
2070
  console.log(`[Trending] Returning trending array with ${trending.length} items`);
2066
2071
  return trending;
2067
2072
  }
@@ -2089,7 +2094,12 @@ const fetchPopularInvestorCategories = async (db) => {
2089
2094
  console.log(`[Categories] Got result for ${dateKey}:`, JSON.stringify(result).substring(0, 500));
2090
2095
  // If we got a result, return it (even if categories object is empty)
2091
2096
  if (result) {
2092
- const categories = result.categories || {};
2097
+ // Handle case where data is wrapped under "undefined" key
2098
+ let categories = result.categories;
2099
+ if (!categories && result.undefined && result.undefined.categories) {
2100
+ categories = result.undefined.categories;
2101
+ }
2102
+ categories = categories || {};
2093
2103
  console.log(`[Categories] Returning categories object with ${Object.keys(categories).length} keys`);
2094
2104
  return categories;
2095
2105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.676",
3
+ "version": "1.0.677",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [