|
@@ -1,4 +1,4 @@
|
|
|
-import mongoose, {
|
|
|
|
|
|
|
+import {
|
|
|
Schema, Model, Document,
|
|
Schema, Model, Document,
|
|
|
} from 'mongoose';
|
|
} from 'mongoose';
|
|
|
|
|
|
|
@@ -28,8 +28,12 @@ const schema = new Schema<UserRegistrationOrderDocument, UserRegistrationOrderMo
|
|
|
token: { type: String, required: true, unique: true },
|
|
token: { type: String, required: true, unique: true },
|
|
|
email: { type: String, required: true },
|
|
email: { type: String, required: true },
|
|
|
isRevoked: { type: Boolean, default: false, required: true },
|
|
isRevoked: { type: Boolean, default: false, required: true },
|
|
|
- createdAt: { type: Date, default: new Date(Date.now()), required: true },
|
|
|
|
|
expiredAt: { type: Date, default: new Date(Date.now() + 600000), required: true },
|
|
expiredAt: { type: Date, default: new Date(Date.now() + 600000), required: true },
|
|
|
|
|
+}, {
|
|
|
|
|
+ timestamps: {
|
|
|
|
|
+ createdAt: true,
|
|
|
|
|
+ updatedAt: false,
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
schema.plugin(uniqueValidator);
|
|
schema.plugin(uniqueValidator);
|
|
|
|
|
|