Update Detailed Product Viev

This commit is contained in:
NW
2024-12-14 00:37:24 +00:00
parent a400d12d16
commit 99137e4e97
3 changed files with 62 additions and 124 deletions

View File

@@ -12,9 +12,10 @@ class ProductService {
static async getDetailedProductById(productId) {
return await db.getAsync(
`SELECT p.*, c.name as category_name
`SELECT p.*, c.name as category_name, l.country, l.city, l.district
FROM products p
JOIN categories c ON p.category_id = c.id
JOIN locations l ON p.location_id = l.id
WHERE p.id = ?`,
[productId]
);