database-connector 2.2.4 → 2.2.5

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/Product.js CHANGED
@@ -259,16 +259,16 @@ productSchema.virtual('PriceMax').get(function () {
259
259
  */
260
260
 
261
261
  // Virtual: array of all product images with full URLs
262
- productSchema.virtual('imagesss').get(function () {
263
- if (this.images != null) {
264
- const images = this.images;
265
- console.log(images);
266
- console.log('images');
267
- return images.map(function (image) {
268
- return `${getBaseURL()}/${image}`;
269
- });
270
- }
271
- });
262
+ // productSchema.virtual('imagesss').get(function () {
263
+ // if (this.images != null) {
264
+ // const images = this.images;
265
+ // console.log(images);
266
+ // console.log('images');
267
+ // return images.map(function (image) {
268
+ // return `${getBaseURL()}/${image}`;
269
+ // });
270
+ // }
271
+ // });
272
272
 
273
273
  // Virtual: discounted price
274
274
  productSchema.virtual('discounted').get(function () {
@@ -281,19 +281,19 @@ productSchema.virtual('discounted').get(function () {
281
281
  });
282
282
 
283
283
  // Virtual: array of all variant images with full URLs
284
- productSchema.virtual('variantImages').get(function () {
285
- if (this.variants != null) {
286
- const variants = this.variants;
287
- console.log(variants);
288
- return variants.map(function (variant) {
289
- if (variant.img != null) {
290
- return `${getBaseURL()}/${variant.img}`;
291
- } else {
292
- return `${getBaseURL()}${getDefaultImagePath()}`;
293
- }
294
- });
295
- }
296
- });
284
+ // productSchema.virtual('variantImages').get(function () {
285
+ // if (this.variants != null) {
286
+ // const variants = this.variants;
287
+ // console.log(variants);
288
+ // return variants.map(function (variant) {
289
+ // if (variant.img != null) {
290
+ // return `${getBaseURL()}/${variant.img}`;
291
+ // } else {
292
+ // return `${getBaseURL()}${getDefaultImagePath()}`;
293
+ // }
294
+ // });
295
+ // }
296
+ // });
297
297
 
298
298
  // Indexes for performance optimization
299
299
  productSchema.index({ storeId: 1, deleted: 1 });
package/models/Store.js CHANGED
@@ -379,12 +379,12 @@ const storeSchema = new mongoose.Schema(
379
379
  { timestamps: true, toJSON: { virtuals: true } }
380
380
  );
381
381
  // Virtual: image URL with base path
382
- storeSchema.virtual('imageUrl').get(function () {
383
- if (this.image != null) {
384
- return `${getBaseURL()}/${this.image}`;
385
- }
386
- return `${getBaseURL()}${getDefaultStoreImagePath()}`;
387
- });
382
+ // storeSchema.virtual('imageUrl').get(function () {
383
+ // if (this.image != null) {
384
+ // return `${getBaseURL()}/${this.image}`;
385
+ // }
386
+ // return `${getBaseURL()}${getDefaultStoreImagePath()}`;
387
+ // });
388
388
  //virtual rating
389
389
  storeSchema.virtual('rating').get(function () {
390
390
  if (this.ratingSum != 0 && this.ratingCount != 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "database-connector",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "MongoDB models package with Mongoose schemas for e-commerce applications. Includes User, Product, Store, Order and more with built-in validation and virtual properties.",
5
5
  "main": "models/index.js",
6
6
  "scripts": {