fix(refactor): patching helpers.tryRoute for API routes, some re-org

Thanks @barisusakli for the tip
This commit is contained in:
Julian Lam
2020-03-30 13:16:29 -04:00
parent d8879d21db
commit d15d9e4492
5 changed files with 36 additions and 14 deletions

View File

@@ -0,0 +1,11 @@
'use strict';
const users = require('../../user');
const helpers = require('../helpers');
const Users = module.exports;
Users.create = async (req, res) => {
const uid = await users.create(req.body);
helpers.formatApiResponse(200, res, await users.getUserData(uid));
};