propro-utils 1.5.83 → 1.5.85
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/middlewares/account_info.js +12 -14
- package/package.json +1 -1
|
@@ -232,13 +232,12 @@ const checkIfUserExists = async accountId => {
|
|
|
232
232
|
await Promise.all(updates);
|
|
233
233
|
|
|
234
234
|
// Return fresh user data after updates
|
|
235
|
-
return userSchema
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
});
|
|
235
|
+
return userSchema.findOne({ accountId });
|
|
236
|
+
// .populate('userGlobalStyles')
|
|
237
|
+
// .populate({
|
|
238
|
+
// path: 'theme',
|
|
239
|
+
// model: 'Theme',
|
|
240
|
+
// });
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
// Create new user with all associated data
|
|
@@ -294,13 +293,12 @@ const checkIfUserExists = async accountId => {
|
|
|
294
293
|
}
|
|
295
294
|
|
|
296
295
|
// Return complete user object with populated fields
|
|
297
|
-
return userSchema
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
});
|
|
296
|
+
return userSchema.findById(newUser._id);
|
|
297
|
+
// .populate('userGlobalStyles')
|
|
298
|
+
// .populate({
|
|
299
|
+
// path: 'theme',
|
|
300
|
+
// model: 'Theme',
|
|
301
|
+
// });
|
|
304
302
|
} catch (error) {
|
|
305
303
|
console.error('Error in checkIfUserExists:', {
|
|
306
304
|
accountId,
|