1 let jst_server = (await import('@ndcode/jst_server')).default
2 let XDate = require('xdate')
5 let get_account = await _require('/_lib/get_account.jst')
6 let get_session = await _require('/_lib/get_session.jst')
7 let post_request = await _require('/_lib/post_request.jst')
13 async nodemailers => {
14 // do not bother trying to coerce and/or validate
15 // too complex and nested (do it when we have an automated routine)
17 let transaction = await env.site.database.Transaction()
19 let root = await transaction.get({})
20 let session = await get_session(env, root)
22 let account = await get_account(root, session)
23 if (account === undefined)
24 throw new jst_server.Problem(
26 'Please sign in first.',
29 if (!await account.get_json('administrator'))
30 throw new jst_server.Problem(
36 root.set_json('nodemailers', nodemailers)
37 await transaction.commit()
40 transaction.rollback()