-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update same time when view chapter
- Loading branch information
1 parent
5e7c68e
commit 0122d39
Showing
3 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import moment from 'moment'; | ||
import mongoose, { Types } from 'mongoose'; | ||
|
||
const ViewerSchema = new mongoose.Schema({ | ||
comicId: { type: Types.ObjectId, required: true, index: true }, | ||
chapterId: { type: Types.ObjectId, required: true, index: true }, | ||
userId: { type: Types.ObjectId, required: false, default: null, index: true }, | ||
createTime: { type: Date, required: false, default: moment().utc().toDate(), index: true }, | ||
createTime: { type: Date, required: true, index: true }, | ||
}); | ||
|
||
export default mongoose.model('Viewer', ViewerSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters