rerobe-js-orm 2.7.18 → 2.7.19
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.
|
@@ -4,7 +4,7 @@ const UserFactory_1 = require("./UserFactory");
|
|
|
4
4
|
const User_1 = require("../../models/User");
|
|
5
5
|
class UserFromAuthTemplateMethod extends UserFactory_1.default {
|
|
6
6
|
createUser(props) {
|
|
7
|
-
const { authUserProfile, prevUserProfile, shoppingBag, savedItems, devicePlatform, shoppingSessionId } = props;
|
|
7
|
+
const { authUserProfile, prevUserProfile, shoppingBag, savedItems, devicePlatform, shoppingSessionId = '', registrationSource = '', } = props;
|
|
8
8
|
let prevShoppingBag = [];
|
|
9
9
|
let prevSavedItems = [];
|
|
10
10
|
if (prevUserProfile) {
|
|
@@ -18,7 +18,7 @@ class UserFromAuthTemplateMethod extends UserFactory_1.default {
|
|
|
18
18
|
[, gid] = this.shopifyHelpers.getDecodedShopifyId(authUserProfile.id).split('Customer/');
|
|
19
19
|
}
|
|
20
20
|
const newUserProfile = Object.assign(Object.assign({}, (prevUserProfile ? prevUserProfile : {})), { uid: authUserProfile.id, gid, displayName: authUserProfile.displayName, firstName: authUserProfile.firstName, lastName: authUserProfile.lastName, email: authUserProfile.email, phone: authUserProfile.phone, addresses: authUserProfile.addresses, referralCode: authUserProfile.id.slice(-7).toLowerCase(), shoppingBag: this.utilities.uniqArray([...prevShoppingBag, ...shoppingBag]), savedItems: this.utilities.uniqArray([...prevSavedItems, ...savedItems]), orders: authUserProfile.orders, devicePlatform,
|
|
21
|
-
shoppingSessionId, lastLogin: new Date().toISOString() });
|
|
21
|
+
shoppingSessionId, lastLogin: new Date().toISOString(), registrationSource });
|
|
22
22
|
return new User_1.default(Object.assign({}, newUserProfile));
|
|
23
23
|
}
|
|
24
24
|
}
|