(req, res)
| 259 | |
| 260 | // Get all users |
| 261 | const GetUser = async (req, res) => { |
| 262 | try { |
| 263 | const users = await User.find({}); |
| 264 | res.json({ |
| 265 | success: true, |
| 266 | message: "Barcha foydalanuvchilar ro'yxati", |
| 267 | users, |
| 268 | }); |
| 269 | } catch (error) { |
| 270 | console.error(error); |
| 271 | res.status(500).json({ |
| 272 | success: false, |
| 273 | message: "Server xatosi, foydalanuvchilarni olishda muammo bo'ldi.", |
| 274 | }); |
| 275 | } |
| 276 | }; |
| 277 | |
| 278 | // Get user by ID |
| 279 | const getUserById = async (req, res) => { |
nothing calls this directly
no outgoing calls
no test coverage detected