mirror of
https://github.com/KevinMidboe/planetposen.git
synced 2025-10-29 17:50:32 +00:00
Use slug for searching specific product.
This commit is contained in:
@@ -29,8 +29,8 @@ class Products {
|
||||
return Product.find().populate('variations');
|
||||
}
|
||||
|
||||
getById(id) {
|
||||
return Product.findById(id).populate('variations');
|
||||
getBySlug(slug) {
|
||||
return Product.findOne({ urlSlug: slug }).populate('variations');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user