/
GlomyWhisper
/
TestWork
Обзор
Документация
Войти
/
GlomyWhisper
/
TestWork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
controllers/user.controller.js
34 строки
666 B
glomywhisper
Initial commit: user service API
17 май 2026, 01:11
17 май 2026, 01:11
9cee241
Код
Авторство
О чём код?
const userService = require('../services/user.service'); async function getUserById(req, res, next) { try { const user = await userService.getUserById(Number(req.params.id)); res.json(user); } catch (error) { next(error); } } async function getUsersList(req, res, next) { try { const users = await userService.getUsersList(); res.json(users); } catch (error) { next(error); } } async function blockUser(req, res, next) { try { const user = await userService.blockUser(Number(req.params.id)); res.json(user); } catch (error) { next(error); } } module.exports = { getUserById, getUsersList, blockUser };