MCPcopy Create free account
hub / github.com/Muhammadsiddiq-code/backend-group-lessons / GetCarById

Function GetCarById

controller/carController.js:68–78  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

66
67// Get car by ID
68const GetCarById = async (req, res) => {
69 try {
70 const car = await Car.findById(req.params.id);
71 if (!car) return res.status(404).json({ message: "Bunday id mavjud emas" });
72
73 res.status(200).json({ message: "Mashina topildi", car });
74 } catch (error) {
75 console.log(error);
76 res.status(500).json({ message: "Internet hatosi" });
77 }
78};
79
80// Update car
81const updateCar = async (req, res) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected