@armi-wave/common 1.23.13 → 1.23.14
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/Follow.js
CHANGED
|
@@ -60,6 +60,8 @@ const followSchema = new mongoose_1.Schema({
|
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot follow the same person multiple times
|
|
62
62
|
followSchema.index({ followerId: 1, followingId: 1 }, { unique: true });
|
|
63
|
+
followSchema.index({ followerId: 1 });
|
|
64
|
+
followSchema.index({ followingId: 1 });
|
|
63
65
|
// Create and export the model
|
|
64
66
|
const Follow = mongoose_1.default.model('Follow', followSchema);
|
|
65
67
|
exports.default = Follow;
|
package/build/models/Like.js
CHANGED
|
@@ -60,6 +60,7 @@ const likeSchema = new mongoose_1.Schema({
|
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot like the same person multiple times
|
|
62
62
|
likeSchema.index({ userId: 1, postId: 1 }, { unique: true });
|
|
63
|
+
likeSchema.index({ userId: 1 });
|
|
63
64
|
// Create and export the model
|
|
64
65
|
const Like = mongoose_1.default.model('Like', likeSchema);
|
|
65
66
|
exports.default = Like;
|
package/build/models/Post.js
CHANGED
|
@@ -50,6 +50,7 @@ const postSchema = new mongoose_1.Schema({
|
|
|
50
50
|
postType: { type: String, required: true },
|
|
51
51
|
reportsNr: { type: Number, required: false, default: 0 },
|
|
52
52
|
contentUrl: { type: String, required: true },
|
|
53
|
+
createdAt: { type: Date, default: Date.now },
|
|
53
54
|
}, {
|
|
54
55
|
toJSON: {
|
|
55
56
|
transform(doc, ret) {
|
package/build/models/Reply.d.ts
CHANGED
package/build/models/Reply.js
CHANGED
|
@@ -49,6 +49,7 @@ const replySchema = new mongoose_1.default.Schema({
|
|
|
49
49
|
upVotes: { type: Number, required: false, default: 0 },
|
|
50
50
|
downVotes: { type: Number, required: false, default: 0 },
|
|
51
51
|
reportsNr: { type: Number, required: false, default: 0 },
|
|
52
|
+
createdAt: { type: Date, default: Date.now },
|
|
52
53
|
}, {
|
|
53
54
|
toJSON: {
|
|
54
55
|
transform(doc, ret) {
|
package/build/models/User.d.ts
CHANGED
package/build/models/User.js
CHANGED
|
@@ -71,6 +71,7 @@ const userSchema = new mongoose_1.Schema({
|
|
|
71
71
|
profession: { type: String, required: false, default: '' },
|
|
72
72
|
grossIncome: { type: Number, required: false, default: 0 },
|
|
73
73
|
netIncome: { type: Number, required: false, default: 0 },
|
|
74
|
+
createdAt: { type: Date, default: Date.now },
|
|
74
75
|
}, {
|
|
75
76
|
toJSON: {
|
|
76
77
|
transform(doc, ret) {
|
|
@@ -86,6 +87,7 @@ const userSchema = new mongoose_1.Schema({
|
|
|
86
87
|
delete ret.profession;
|
|
87
88
|
delete ret.grossIncome;
|
|
88
89
|
delete ret.netIncome;
|
|
90
|
+
delete ret.createdAt;
|
|
89
91
|
},
|
|
90
92
|
},
|
|
91
93
|
});
|