let transaction = await env.site.database.Transaction()
try {
- let account = await get_account(
- env,
- transaction,
- await get_session(env, transaction)
- )
+ let root = await transaction.get({})
+ let session = await get_session(env, root)
+
+ let account = await get_account(root, session)
if (account === undefined)
throw new Problem('Unauthorized', 'Please sign in first.', 401)
-
if (!await account.get_json('administrator'))
throw new Problem('Unauthorized', 'Not administrator.', 401)
- ;(await transaction.get({})).set_json('nodemailer', nodemailer)
+ root.set_json('nodemailer', nodemailer)
await transaction.commit()
}
catch (error) {