fix delete user

master
tnud0 2 years ago
parent 6dfbe3b006
commit 3c9f2c8ca0
  1. 1
      package.json
  2. 1
      src/api/controllers/v1/auth.controller.js
  3. 5
      src/api/controllers/v1/user.controller.js

@ -18,7 +18,6 @@
"instrument": false
},
"scripts": {
"precommit": "yarn lint",
"clean": "./node_modules/.bin/rimraf dist -p",
"build": "yarn run clean && mkdir -p dist && ./node_modules/.bin/babel src -s -D -d dist",
"start": "cross-env NODE_ENV=production pm2 start ./dist/index.js",

@ -1,5 +1,4 @@
import { hash, compare } from 'bcryptjs';
import messages from '../../../config/messages';
import { hash, compare } from 'bcryptjs';
import { handler as ErrorHandler } from '../../middlewares/error';

@ -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)

Loading…
Cancel
Save