/var/www/p4ela.kz/server/delivery/api/controllers/account
NameSizeModeActions
create.js25060644editdlrm
delete.js12510644editdlrm
details.js9190644editdlrm
history.js11140644editdlrm
list.js13410644editdlrm
put.js16480644editdlrm
statistic.js48270644editdlrm
transfer.js27870644editdlrm
withdraw.js16430644editdlrm
Edit: /var/www/p4ela.kz/server/delivery/api/controllers/account/details.js (919B)
const { NotFound, BadRequest } = require('../../responseModels/errors') const { isSet, isEmpty } = require('../../utils/validator.util') const checkPermission = require('../../utils/checkPermission.util') module.exports = function ({ db, logger }) { return async (req, res, next) => { logger.child({ path: req.path, request: req.params }).info() let t1 = performance.now() try { const { uid } = req.params if (!isSet(uid) || isEmpty(uid)) throw new BadRequest({ code: 1027, lang: req.user?.languageCode }) const account = await db.account.findOne({ where: { uid }, include: [ { model: db.accountHistory, order: [['createdAt', 'DESC']], limit: 3 } ] }) if (!account) throw new NotFound({ code: 1030, lang: req.user?.languageCode }) const time = performance.now() - t1 return res.status(200).json(account) } catch (err) { next(err) } } }