mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
Merge branch 'release' into sabrecat/usernames-master
This commit is contained in:
@@ -14,19 +14,20 @@ const defaultSchema = () => ({
|
||||
contributor: {type: mongoose.Schema.Types.Mixed},
|
||||
backer: {type: mongoose.Schema.Types.Mixed},
|
||||
uuid: String, // sender uuid
|
||||
userStyles: {type: mongoose.Schema.Types.Mixed},
|
||||
userStyles: {$type: mongoose.Schema.Types.Mixed},
|
||||
|
||||
flags: {type: mongoose.Schema.Types.Mixed, default: {}},
|
||||
flagCount: {type: Number, default: 0},
|
||||
likes: {type: mongoose.Schema.Types.Mixed},
|
||||
_meta: {type: mongoose.Schema.Types.Mixed},
|
||||
flags: {$type: mongoose.Schema.Types.Mixed, default: {}},
|
||||
flagCount: {$type: Number, default: 0},
|
||||
likes: {$type: mongoose.Schema.Types.Mixed},
|
||||
_meta: {$type: mongoose.Schema.Types.Mixed},
|
||||
});
|
||||
|
||||
const chatSchema = new mongoose.Schema({
|
||||
...defaultSchema(),
|
||||
groupId: {type: String, ref: 'Group'},
|
||||
groupId: {$type: String, ref: 'Group'},
|
||||
}, {
|
||||
minimize: false, // Allow for empty flags to be saved
|
||||
typeKey: '$type', // So that we can use fields named `type`
|
||||
});
|
||||
|
||||
chatSchema.plugin(baseModel, {
|
||||
@@ -34,14 +35,15 @@ chatSchema.plugin(baseModel, {
|
||||
});
|
||||
|
||||
const inboxSchema = new mongoose.Schema({
|
||||
sent: {type: Boolean, default: false}, // if the owner sent this message
|
||||
sent: {$type: Boolean, default: false}, // if the owner sent this message
|
||||
// the uuid of the user where the message is stored,
|
||||
// we store two copies of each inbox messages:
|
||||
// one for the sender and one for the receiver
|
||||
ownerId: {type: String, ref: 'User'},
|
||||
ownerId: {$type: String, ref: 'User'},
|
||||
...defaultSchema(),
|
||||
}, {
|
||||
minimize: false, // Allow for empty flags to be saved
|
||||
typeKey: '$type', // So that we can use fields named `type`
|
||||
});
|
||||
|
||||
inboxSchema.plugin(baseModel, {
|
||||
|
||||
Reference in New Issue
Block a user