goldstars-services 1.0.61 → 1.0.62
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.
|
@@ -62,6 +62,8 @@ var reportSchema = new _mongoose.default.Schema({
|
|
|
62
62
|
type: Date,
|
|
63
63
|
default: Date.now
|
|
64
64
|
}
|
|
65
|
+
}, {
|
|
66
|
+
timestamps: true // This adds createdAt and updatedAt fields automatically
|
|
65
67
|
});
|
|
66
68
|
reportSchema.pre('save', function (next) {
|
|
67
69
|
this.lastChangeDate = Date.now();
|
|
@@ -91,7 +91,12 @@ var UserSchema = Schema({
|
|
|
91
91
|
});
|
|
92
92
|
UserSchema.pre("save", /*#__PURE__*/function () {
|
|
93
93
|
var _ref = _asyncToGenerator(function* (next) {
|
|
94
|
+
console.log('=== PRE-SAVE DEBUG ===');
|
|
95
|
+
console.log('Usuario antes de encriptar password:', this.toObject());
|
|
96
|
+
console.log('confirmEmail en pre-save:', this.confirmEmail);
|
|
94
97
|
this.password = yield (0, _encrypt.encrypt)(this.password);
|
|
98
|
+
console.log('Usuario después de encriptar password:', this.toObject());
|
|
99
|
+
console.log('confirmEmail después de encriptar:', this.confirmEmail);
|
|
95
100
|
next();
|
|
96
101
|
});
|
|
97
102
|
return function (_x) {
|
|
@@ -37,12 +37,17 @@ var populateQueryUserData = userQuery => {
|
|
|
37
37
|
* @returns {Promise<UserModel>}
|
|
38
38
|
*/
|
|
39
39
|
var createUser = (params, isTrainer) => {
|
|
40
|
+
console.log('=== DEBUG createUser en MicroService ===');
|
|
41
|
+
console.log('Parámetros recibidos:', params);
|
|
42
|
+
console.log('confirmEmail recibido:', params.confirmEmail);
|
|
40
43
|
var userBody = params;
|
|
41
44
|
if (isTrainer) {
|
|
42
45
|
userBody["isTrainer"] = {
|
|
43
46
|
confirmed: false
|
|
44
47
|
};
|
|
45
48
|
}
|
|
49
|
+
console.log('userBody final antes de guardar:', userBody);
|
|
50
|
+
console.log('confirmEmail en userBody:', userBody.confirmEmail);
|
|
46
51
|
var User = new _user.default(userBody);
|
|
47
52
|
return User.save();
|
|
48
53
|
};
|