(req, res)
| 148 | |
| 149 | // getClasById |
| 150 | const GetClassById = async (req, res) => { |
| 151 | try { |
| 152 | const classId = await Class.findById(req.params.id); |
| 153 | if (!classId) return |
| 154 | res.status(404).json({ |
| 155 | message: "bunday uquvchi mavjud emas" |
| 156 | }) |
| 157 | res.status(200).json({ |
| 158 | succes: true, |
| 159 | message: "Uquvchi topildi", |
| 160 | classId, |
| 161 | }); |
| 162 | } |
| 163 | catch (error) { |
| 164 | console.log(error); |
| 165 | res.status(500).json({ |
| 166 | message: "Serverda xatolik", |
| 167 | }); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | // updateClass |
| 172 | // const updateClass = async (req, res) => { |
nothing calls this directly
no outgoing calls
no test coverage detected