feat/board-option-lose-points (#4)

Reviewed-on: #4
Co-authored-by: Baer <jeobeardy@proton.me>
Co-committed-by: Baer <jeobeardy@proton.me>
This commit was merged in pull request #4.
This commit is contained in:
jeobeardy authored and jeobeardy committed 2026-05-01 17:39:21 +02:00
1 parent ef56c1d9c1
commit 600c3a1836
12 files changed
+48 -10

No files matched your search

+2
View File
@@ -6,6 +6,7 @@ const BoardSchema = new Schema({
ownerId: { type: Schema.Types.ObjectId, ref: "User", required: true },
name: { type: String, required: true, maxLength: 100 },
categories: { type: [Object], required: false, default: [] },
options: { type: Object, required: true, default: { losePointsOnWrong: false, lossMultiplier: 1, onlyOnBuzzer: true } }
});
// Virtual for player's URL
@@ -17,6 +18,7 @@ BoardSchema.virtual("url").get(function () {
BoardSchema.virtual("setFromPostObject").set( function( postObject ){
this.name = postObject.boardName;
this.categories = postObject.categories;
this.options = postObject.options;
})
// Export model