This commit is contained in:
echo committed 2025-06-24 21:48:03 +02:00
1 parent 0fa3c7ac48
commit 464e80f09e
20 files changed
+624 -188

No files matched your search

+17 -17
View File
@@ -23,9 +23,9 @@ let ProductService = class ProductService {
include: {
prices: {
include: { source: true },
orderBy: { lastUpdated: 'desc' }
}
}
orderBy: { lastUpdated: 'desc' },
},
},
});
}
async getProducts(params) {
@@ -40,9 +40,9 @@ let ProductService = class ProductService {
prices: {
include: { source: true },
orderBy: { lastUpdated: 'desc' },
take: 1
}
}
take: 1,
},
},
});
}
async searchProducts(query) {
@@ -51,16 +51,16 @@ let ProductService = class ProductService {
OR: [
{ name: { contains: query, mode: 'insensitive' } },
{ description: { contains: query, mode: 'insensitive' } },
{ category: { contains: query, mode: 'insensitive' } }
]
{ category: { contains: query, mode: 'insensitive' } },
],
},
include: {
prices: {
include: { source: true },
orderBy: { lastUpdated: 'desc' },
take: 1
}
}
take: 1,
},
},
});
}
async createProduct(data) {
@@ -68,9 +68,9 @@ let ProductService = class ProductService {
data,
include: {
prices: {
include: { source: true }
}
}
include: { source: true },
},
},
});
}
async updateProduct(params) {
@@ -80,9 +80,9 @@ let ProductService = class ProductService {
where,
include: {
prices: {
include: { source: true }
}
}
include: { source: true },
},
},
});
}
};