flykup_model_development 1.0.2 → 1.0.4
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/models/Wishlist.model.js
CHANGED
|
@@ -25,5 +25,5 @@ const WishlistSchema = new Schema(
|
|
|
25
25
|
// Add compound index to prevent duplicate entries
|
|
26
26
|
WishlistSchema.index({ userId: 1, productId: 1 }, { unique: true });
|
|
27
27
|
|
|
28
|
-
const Wishlist = mongoose.models.
|
|
28
|
+
const Wishlist = mongoose.models.wishlists || mongoose.model("wishlists", WishlistSchema);
|
|
29
29
|
export default Wishlist;
|
|
@@ -128,5 +128,5 @@ totalReviews: { type: Number, default: 0 }
|
|
|
128
128
|
// ProductListingSchema.set('strict', false); // Use with caution
|
|
129
129
|
|
|
130
130
|
// Safe export to prevent OverwriteModelError
|
|
131
|
-
const ProductListing = mongoose.models.
|
|
131
|
+
const ProductListing = mongoose.models.productlistings || mongoose.model("productlistings", ProductListingSchema);
|
|
132
132
|
export default ProductListing;
|
|
@@ -172,6 +172,6 @@ ShoppableVideoSchema.index({ processingStatus: 1, updatedAt: 1 });
|
|
|
172
172
|
// Index for host and their videos
|
|
173
173
|
ShoppableVideoSchema.index({ host: 1, hostModel: 1 });
|
|
174
174
|
|
|
175
|
-
const ShoppableVideo = mongoose.models.
|
|
175
|
+
const ShoppableVideo = mongoose.models.shoppablevideo || mongoose.model("shoppablevideos", ShoppableVideoSchema);
|
|
176
176
|
|
|
177
177
|
export default ShoppableVideo;
|