code review
This commit is contained in:
parent
15279f2c41
commit
ccb6b59588
|
@ -20,7 +20,7 @@ exports.fetch = async function(ctx) {
|
||||||
|
|
||||||
exports.create = async function(ctx) {
|
exports.create = async function(ctx) {
|
||||||
const db = new CouchDB(ctx.user.appId)
|
const db = new CouchDB(ctx.user.appId)
|
||||||
const { email, password, name, accessLevelId, permissions } = ctx.request.body
|
const { email, password, accessLevelId, permissions } = ctx.request.body
|
||||||
|
|
||||||
if (!email || !password) {
|
if (!email || !password) {
|
||||||
ctx.throw(400, "email and Password Required.")
|
ctx.throw(400, "email and Password Required.")
|
||||||
|
@ -34,7 +34,6 @@ exports.create = async function(ctx) {
|
||||||
_id: generateUserID(email),
|
_id: generateUserID(email),
|
||||||
email,
|
email,
|
||||||
password: await bcrypt.hash(password),
|
password: await bcrypt.hash(password),
|
||||||
name,
|
|
||||||
type: "user",
|
type: "user",
|
||||||
accessLevelId,
|
accessLevelId,
|
||||||
permissions: permissions || [BUILTIN_PERMISSION_NAMES.POWER],
|
permissions: permissions || [BUILTIN_PERMISSION_NAMES.POWER],
|
||||||
|
|
|
@ -118,7 +118,7 @@ exports.clearApplications = async request => {
|
||||||
exports.createUser = async (
|
exports.createUser = async (
|
||||||
request,
|
request,
|
||||||
appId,
|
appId,
|
||||||
email = "babs",
|
email = "babs@babs.com",
|
||||||
password = "babs_password"
|
password = "babs_password"
|
||||||
) => {
|
) => {
|
||||||
const res = await request
|
const res = await request
|
||||||
|
|
Loading…
Reference in New Issue