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.
@@ -33,6 +33,7 @@ const NewProductSchema = new Schema(
33
33
  default: null,
34
34
  },
35
35
  storeUrl: { type: String, default: "" },
36
+ handle: { type: String, default: "" },
36
37
  },
37
38
  {
38
39
  timestamps: true,
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.5.01",
3
+ "version": "1.5.03",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {