mirror of
https://github.com/Permissionless-Software-Foundation/bch-email-api.git
synced 2026-09-21 16:52:04 -07:00
Started to flesh in the createUser() function
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
mailbox table in the iRedMail postgres database.
|
mailbox table in the iRedMail postgres database.
|
||||||
|
|
||||||
The constructor cxpects an instantiation of the sequalize class. Returns a
|
The constructor expects an instantiation of the sequalize class. Returns a
|
||||||
Sequelize model.
|
Sequelize model.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,18 @@ const util = require('util')
|
|||||||
util.inspect.defaultOptions = { depth: 1 }
|
util.inspect.defaultOptions = { depth: 1 }
|
||||||
|
|
||||||
async function createUser (ctx) {
|
async function createUser (ctx) {
|
||||||
ctx.body = {}
|
try {
|
||||||
|
const modelMailbox = await ctx.iRedMail.models.mailbox.sync()
|
||||||
|
const modelForwardings = await ctx.iRedMail.models.forwardings.sync()
|
||||||
|
|
||||||
|
// http://docs.sequelizejs.com/
|
||||||
|
// await modelMailbox.create({})
|
||||||
|
|
||||||
|
ctx.body = {}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(`Error in iredmail.createUser(): `, err)
|
||||||
|
ctx.throw(500, err.message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -25,10 +36,10 @@ async function getUsers (ctx) {
|
|||||||
|
|
||||||
ctx.body = users
|
ctx.body = users
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(`Error in iredmail.createUser(): `, err)
|
console.log(`Error in iredmail.getUsers(): `, err)
|
||||||
ctx.throw(500, err.message)
|
ctx.throw(500, err.message)
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
const user = new User(ctx.request.body.user)
|
const user = new User(ctx.request.body.user)
|
||||||
try {
|
try {
|
||||||
await user.save()
|
await user.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user