@common_ch/common 1.0.115 → 1.0.117
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/build/models/app/user.js +4 -2
- package/package.json +1 -1
package/build/models/app/user.js
CHANGED
|
@@ -135,6 +135,7 @@ userSchema.statics.build = (attrs) => {
|
|
|
135
135
|
};
|
|
136
136
|
userSchema.pre('save', function (done) {
|
|
137
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
var _a;
|
|
138
139
|
if (this.isModified('password')) {
|
|
139
140
|
if (this.get('password')) {
|
|
140
141
|
const hashed = yield password_1.Password.toHash(this.get('password'));
|
|
@@ -142,13 +143,14 @@ userSchema.pre('save', function (done) {
|
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
if (this.isModified('versionPlanMessage')) {
|
|
146
|
+
const currentVersion = (_a = this.get('versionPlanMessage')) !== null && _a !== void 0 ? _a : 0;
|
|
145
147
|
this.$where = {
|
|
146
|
-
versionPlanMessage:
|
|
148
|
+
versionPlanMessage: currentVersion - 1,
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
else {
|
|
150
152
|
this.$where = {
|
|
151
|
-
version: this.get('version'),
|
|
153
|
+
version: this.get('version') - 1,
|
|
152
154
|
};
|
|
153
155
|
}
|
|
154
156
|
done();
|