|
|
@@ -63,6 +63,7 @@ module.exports = function(crowi) {
|
|
|
createdAt: { type: Date, default: Date.now },
|
|
|
lastLoginAt: { type: Date },
|
|
|
admin: { type: Boolean, default: 0, index: true },
|
|
|
+ invitationEmailSended: { type: Date, default: null },
|
|
|
}, {
|
|
|
toObject: {
|
|
|
transform: (doc, ret, opt) => {
|
|
|
@@ -682,6 +683,17 @@ module.exports = function(crowi) {
|
|
|
return username;
|
|
|
};
|
|
|
|
|
|
+ userSchema.statics.updateInvitationEmailSended = async function(id) {
|
|
|
+ const user = await this.findById(id);
|
|
|
+
|
|
|
+ if (!user) {
|
|
|
+ throw new Error('User not found');
|
|
|
+ }
|
|
|
+
|
|
|
+ user.invitationEmailSended = new Date();
|
|
|
+ user.save();
|
|
|
+ };
|
|
|
+
|
|
|
class UserUpperLimitException {
|
|
|
|
|
|
constructor() {
|