propro-utils 1.5.73 → 1.5.75

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.
@@ -123,10 +123,10 @@ const checkIfUserExists = async accountId => {
123
123
  const folderSchema = await ServiceManager.getService('FolderSchema');
124
124
  const themeSchema = await ServiceManager.getService('ThemeSchema');
125
125
 
126
- console.log('themeschema', themeSchema);
127
126
  let user = await userSchema
128
127
  .findOne({ accountId })
129
- .populate('userGlobalStyles');
128
+ .populate('userGlobalStyles')
129
+ .populate('theme');
130
130
 
131
131
  if (user) {
132
132
  if (!user.userGlobalStyles) {
@@ -171,7 +171,7 @@ const checkIfUserExists = async accountId => {
171
171
  userId: user.id,
172
172
  id: uuidv4(),
173
173
  });
174
- user.theme = defaultTheme._id;
174
+ user.theme = [defaultTheme._id];
175
175
  await user.save();
176
176
  }
177
177
 
@@ -200,7 +200,7 @@ const checkIfUserExists = async accountId => {
200
200
  userId: user.id,
201
201
  id: uuidv4(),
202
202
  });
203
- user.theme = defaultTheme._id;
203
+ user.theme = [defaultTheme._id];
204
204
  await user.save();
205
205
 
206
206
  return user;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.5.73",
3
+ "version": "1.5.75",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -45,6 +45,7 @@ const sanitizeUser = user => {
45
45
  sanitized.createdAt = sanitized._doc.createdAt;
46
46
  sanitized.updatedAt = sanitized._doc.updatedAt;
47
47
  sanitized.userGlobalStyles = sanitized._doc.userGlobalStyles;
48
+ sanitized.theme = sanitized._doc.theme;
48
49
 
49
50
  delete sanitized._doc.mapList;
50
51
  delete sanitized._doc.folderList;