propro-utils 1.5.54 → 1.5.57
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 +10 -3
- package/package.json +1 -1
|
@@ -68,10 +68,11 @@ const getAccountProfile = async (redisClient, userSchema, accountId) => {
|
|
|
68
68
|
* @param {string} accountId - The account ID of the user.
|
|
69
69
|
* @returns {Promise<Object>} A promise that resolves to the created user global styles object.
|
|
70
70
|
*/
|
|
71
|
-
async function createUserGlobalStyles(userStyleSchema) {
|
|
71
|
+
async function createUserGlobalStyles(userStyleSchema, accountId) {
|
|
72
72
|
return await userStyleSchema.create({
|
|
73
73
|
id: uuidv4(),
|
|
74
74
|
styleShortcuts: defaultUserGlobalStyleShortcuts,
|
|
75
|
+
accountId,
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -119,7 +120,10 @@ const checkIfUserExists = async accountId => {
|
|
|
119
120
|
|
|
120
121
|
if (user) {
|
|
121
122
|
if (!user.userGlobalStyles) {
|
|
122
|
-
user.userGlobalStyles = await createUserGlobalStyles(
|
|
123
|
+
user.userGlobalStyles = await createUserGlobalStyles(
|
|
124
|
+
userStyleSchema,
|
|
125
|
+
accountId
|
|
126
|
+
);
|
|
123
127
|
await user.save();
|
|
124
128
|
} else if (user.userGlobalStyles.styleShortcuts.length === 0) {
|
|
125
129
|
user.userGlobalStyles.styleShortcuts = defaultUserGlobalStyleShortcuts;
|
|
@@ -148,7 +152,10 @@ const checkIfUserExists = async accountId => {
|
|
|
148
152
|
return user;
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
const userGlobalStyles = await createUserGlobalStyles(
|
|
155
|
+
const userGlobalStyles = await createUserGlobalStyles(
|
|
156
|
+
userStyleSchema,
|
|
157
|
+
accountId
|
|
158
|
+
);
|
|
152
159
|
|
|
153
160
|
user = await userSchema.create({
|
|
154
161
|
accountId,
|