|
|
|
@ -1,3 +1,4 @@ |
|
|
|
|
import { hash } from 'bcryptjs'; |
|
|
|
|
import { pick } from 'lodash'; |
|
|
|
|
// import httpStatus from 'http-status';
|
|
|
|
|
import messages from '../../../config/messages'; |
|
|
|
@ -5,7 +6,6 @@ import messages from '../../../config/messages'; |
|
|
|
|
import { handler as ErrorHandler } from '../../middlewares/error'; |
|
|
|
|
import User from '../../../common/models/user.model'; |
|
|
|
|
import uploadAdapter from '../../../common/services/adapters/upload-adapter'; |
|
|
|
|
import { hash } from 'bcryptjs'; |
|
|
|
|
/** |
|
|
|
|
* Create |
|
|
|
|
* |
|
|
|
@ -41,6 +41,7 @@ exports.create = async (req, res, next) => { |
|
|
|
|
* @returns {Promise<StorySchema[]>, APIException>} |
|
|
|
|
*/ |
|
|
|
|
exports.list = async (req, res, next) => { |
|
|
|
|
req.query.services = User.Services.USER |
|
|
|
|
User.list( |
|
|
|
|
req.query |
|
|
|
|
).then(result => { |
|
|
|
@ -75,7 +76,7 @@ exports.get = async (req, res, next) => res.json({ data: User.transform(req.loca |
|
|
|
|
exports.update = async (req, res, next) => { |
|
|
|
|
const { user } = req.locals; |
|
|
|
|
const dataChanged = User.getChangedProperties(req.body); |
|
|
|
|
let new_properties = pick(req.body, dataChanged); |
|
|
|
|
const new_properties = pick(req.body, dataChanged); |
|
|
|
|
// const updateUser = Object.assign(
|
|
|
|
|
// user,
|
|
|
|
|
// pick(req.body, dataChanged)
|
|
|
|
|