shuttlepro-shared 1.5.2 → 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/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.02",
3
+ "version": "1.5.03",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {