Add /_lib/get_globals.jst
[ndcode_site.git] / api / contact / send_enquiry.json.jst
index 127bc7c..da3ff60 100644 (file)
@@ -1,9 +1,10 @@
 let nodemailer = require('nodemailer')
 let XDate = require('xdate')
 
-return async env => {
-  let post_request = await _require('/_lib/post_request.jst')
+return async env => {a
+  let get_globals = await _require('/_lib/get_globals.jst')
   let get_session = await _require('/_lib/get_session.jst')
+  let post_request = await _require('/_lib/post_request.jst')
   let Problem = await _require('/_lib/Problem.jst')
 
   await post_request(
@@ -36,11 +37,14 @@ return async env => {
         // initialize env.session_key, set cookie in env.response
         get_session(env, transaction)
 
-        let root = await transaction.get({})
         nodemailer_contact = nodemailer.createTransport(
-          await (await root.get('nodemailer')).get_json('contact')
+          await (
+            await (
+              await transaction.get({})
+            ).get('nodemailer')
+          ).get_json('contact')
         )
-        let globals = await root.get('globals')
+        let globals = await get_globals(env, transaction)
         contact_from = await globals.get_json('contact_from')
         contact_to = await globals.get_json('contact_to')