Initial commit
This commit is contained in:
9
server/models/Wishlist.js
Normal file
9
server/models/Wishlist.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const wishlistSchema = new mongoose.Schema({
|
||||
user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true, unique: true },
|
||||
products: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Product' }]
|
||||
}, { timestamps: true });
|
||||
|
||||
module.exports = mongoose.model('Wishlist', wishlistSchema);
|
||||
|
||||
Reference in New Issue
Block a user