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

Function GetClassById

controller/classController.js:150–169  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

148
149// getClasById
150const 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) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected