(req, res)
| 66 | |
| 67 | // Get car by ID |
| 68 | const 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 |
| 81 | const updateCar = async (req, res) => { |
nothing calls this directly
no outgoing calls
no test coverage detected