added jsdoc definitions to apis
This commit is contained in:
@@ -1,13 +1,28 @@
|
||||
/**
|
||||
* @swagger
|
||||
* /api/email/notify:
|
||||
* get:
|
||||
* post:
|
||||
* tags:
|
||||
* - Email
|
||||
* summary: Email to user
|
||||
* consumes:
|
||||
* - application/json
|
||||
* description: Send email via gov notify
|
||||
* produces: [
|
||||
* "application/json",
|
||||
* "application/xml"
|
||||
* ]
|
||||
* requestBody:
|
||||
* name: Email
|
||||
* description: Email body
|
||||
* required: true
|
||||
* content:
|
||||
* 'application/json':
|
||||
* schema:
|
||||
* $ref: "#/components/schemas/emailBody"
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Success
|
||||
* 405:
|
||||
* description: Failed
|
||||
*/
|
||||
|
||||
import { consoleLogger } from "../../../actions";
|
||||
@@ -20,7 +35,7 @@ export default async function ApiProxy(req, res) {
|
||||
const notifyClient = new NotifyClient(process.env.NOTIFY_API_KEY);
|
||||
//const emailReplyToId = process.env.EMAIL_REPLY_TO_ID;
|
||||
|
||||
console.log("///////////////\n Sending email \ns//////////////");
|
||||
console.log("///////////////\n Sending email \ns//////////////", data);
|
||||
|
||||
notifyClient
|
||||
.sendEmail(data.templateId, data.emailAddress, {
|
||||
@@ -29,7 +44,7 @@ export default async function ApiProxy(req, res) {
|
||||
// emailReplyToId: emailReplyToId,
|
||||
})
|
||||
.then((response) => {
|
||||
//console.log("thisis the response", response);
|
||||
console.log("thisis the response", response);
|
||||
return res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user