fixed cars_make
This commit is contained in:
parent
6c29105cb0
commit
f477877e91
@ -30,7 +30,7 @@ exports.getModelsByMake = async (req, res) => {
|
|||||||
return res.status(400).json({ message: "Missing `make` parameter" });
|
return res.status(400).json({ message: "Missing `make` parameter" });
|
||||||
}
|
}
|
||||||
|
|
||||||
const models = await Car.distinct("model", { make });
|
const models = await CarModel.distinct("model", { make });
|
||||||
|
|
||||||
if (models.length === 0) {
|
if (models.length === 0) {
|
||||||
return res.status(404).json({ message: "No models found for this make" });
|
return res.status(404).json({ message: "No models found for this make" });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user