shuttlepro-shared 1.5.1 → 1.5.3
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.
- package/models/NewProduct.js +1 -0
- package/models/Product.js +2 -0
- package/models/Profile.js +5 -4
- package/package.json +1 -1
package/models/NewProduct.js
CHANGED
package/models/Product.js
CHANGED
|
@@ -176,6 +176,8 @@ const transformProductData = async (product) => {
|
|
|
176
176
|
presentedCurrency: populatedProduct?.presentedCurrency || "",
|
|
177
177
|
presentedCurrencySymbol: populatedProduct?.presentedCurrencySymbol || "",
|
|
178
178
|
websiteId: populatedProduct?.websiteId || null,
|
|
179
|
+
storeUrl: populatedProduct?.storeUrl || "",
|
|
180
|
+
handle: populatedProduct?.handle || "",
|
|
179
181
|
};
|
|
180
182
|
};
|
|
181
183
|
|
package/models/Profile.js
CHANGED
|
@@ -58,11 +58,12 @@ const fetchProfiles = async (workspaceId) => {
|
|
|
58
58
|
const fetchByProfileIdAndWorkspaceId = async (id, workspaceId) => {
|
|
59
59
|
try {
|
|
60
60
|
// Direct database fetch without Redis (to avoid Redis issues in webhook routes)
|
|
61
|
+
const orConditions = [{ profileId: id }];
|
|
62
|
+
if (mongoose.isValidObjectId(id)) {
|
|
63
|
+
orConditions.push({ _id: id });
|
|
64
|
+
}
|
|
61
65
|
const profile = await Profile.findOne({
|
|
62
|
-
$or:
|
|
63
|
-
{ profileId: id },
|
|
64
|
-
{ _id: id }
|
|
65
|
-
],
|
|
66
|
+
$or: orConditions,
|
|
66
67
|
workspaceId: workspaceId
|
|
67
68
|
}).lean().exec();
|
|
68
69
|
return profile || null;
|