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.
|
||||
|
||||
The constructor cxpects an instantiation of the sequalize class. Returns a
|
||||
The constructor expects an instantiation of the sequalize class. Returns a
|
||||
Sequelize model.
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,7 +4,18 @@ const util = require('util')
|
||||
util.inspect.defaultOptions = { depth: 1 }
|
||||
|
||||
async function createUser (ctx) {
|
||||
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,7 +36,7 @@ async function getUsers (ctx) {
|
||||
|
||||
ctx.body = users
|
||||
} catch (err) {
|
||||
console.log(`Error in iredmail.createUser(): `, err)
|
||||
console.log(`Error in iredmail.getUsers(): `, err)
|
||||
ctx.throw(500, err.message)
|
||||
}
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user