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

Function GetUser

controller/userController.js:261–276  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

259
260// Get all users
261const 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
279const getUserById = async (req, res) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected