propro-utils 1.5.96 → 1.5.97

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.
@@ -6,7 +6,6 @@ const ServiceManager = require('../utils/serviceManager');
6
6
  const defaultUserGlobalStyleShortcuts =
7
7
  require('./defaultUserGlobalStyleShortcuts.json').defaultGlobalStyleShortcuts;
8
8
  const defaultFolders = require('./defaultFolders.json').defaultFolders;
9
- const User = require('../models/user');
10
9
 
11
10
  /**
12
11
  * Retrieves the account profile data from the authentication server and caches it using Redis.
@@ -360,9 +359,9 @@ const checkIfUserExists = async accountId => {
360
359
 
361
360
  const updateUserGlobalStyleShortcuts = async (userId, shortcutId, shortcut) => {
362
361
  try {
363
- const user = await User.findOne({ id: userId }).populate(
364
- 'userGlobalStyles'
365
- );
362
+ const user = await userSchema
363
+ .findOne({ id: userId })
364
+ .populate('userGlobalStyles');
366
365
  if (!user) {
367
366
  throw new Error('User not found');
368
367
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.5.96",
3
+ "version": "1.5.97",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {