Skip to content

Commit 3eec5dc

Browse files
committed
fix: immutable user and slug
1 parent dc74ecd commit 3eec5dc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server/models/project.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const projectSchema = new Schema(
3434
default: "Hello p5.js, it's the server",
3535
maxlength: 128
3636
},
37-
user: { type: Schema.Types.ObjectId, ref: 'User' },
37+
user: { type: Schema.Types.ObjectId, ref: 'User', immutable: true },
3838
serveSecure: { type: Boolean, default: false },
3939
files: { type: [fileSchema] },
4040
_id: { type: String, default: shortid.generate },
@@ -43,7 +43,7 @@ const projectSchema = new Schema(
4343
enum: ['Private', 'Public'],
4444
default: 'Public'
4545
},
46-
slug: { type: String }
46+
slug: { type: String, immutable: true }
4747
},
4848
{ timestamps: true }
4949
);

0 commit comments

Comments
 (0)