From: Nick Downing Date: Mon, 24 Jan 2022 01:05:06 +0000 (+1100) Subject: Structure upgrade: change nodemailer to nodemailers, and rename API endpoints X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?p=ndcode_site.git;a=commitdiff_plain;h=bc90a3fd75216511be7b91166719244bd7dd82f2 Structure upgrade: change nodemailer to nodemailers, and rename API endpoints --- diff --git a/_config/n.sh b/_config/n.sh index 5bcb282..419f2e7 100755 --- a/_config/n.sh +++ b/_config/n.sh @@ -1,3 +1,3 @@ #!/bin/sh ./set.mjs /api/globals/set.json { - let _nodemailer = await root.get('nodemailer') - return nodemailer.createTransport(await _nodemailer.get_json(name)) + let nodemailers = await root.get('nodemailers') + return nodemailer.createTransport(await nodemailers.get_json(name)) } diff --git a/api/nodemailer/get.json.jst b/api/nodemailers/get.json.jst similarity index 93% rename from api/nodemailer/get.json.jst rename to api/nodemailers/get.json.jst index 2aa421d..2aa640c 100644 --- a/api/nodemailer/get.json.jst +++ b/api/nodemailers/get.json.jst @@ -22,7 +22,7 @@ return async env => { if (!await account.get_json('administrator')) throw new Problem('Unauthorized', 'Not administrator.', 401) - return /*await*/ root.get_json('nodemailer', {}) + return /*await*/ root.get_json('nodemailers', {}) } finally { transaction.rollback() diff --git a/api/nodemailer/set.json.jst b/api/nodemailers/set.json.jst similarity index 93% rename from api/nodemailer/set.json.jst rename to api/nodemailers/set.json.jst index 623c002..808fe5b 100644 --- a/api/nodemailer/set.json.jst +++ b/api/nodemailers/set.json.jst @@ -10,7 +10,7 @@ return async env => { // env env, // handler - async nodemailer => { + async nodemailers => { // do not bother trying to coerce and/or validate // too complex and nested (do it when we have an automated routine) @@ -25,7 +25,7 @@ return async env => { if (!await account.get_json('administrator')) throw new Problem('Unauthorized', 'Not administrator.', 401) - root.set_json('nodemailer', nodemailer) + root.set_json('nodemailers', nodemailers) await transaction.commit() } catch (error) {