added jsdoc definitions to apis

This commit is contained in:
2023-03-10 12:21:10 +00:00
parent d8f0972170
commit 6dc71b894a
59 changed files with 2288 additions and 64 deletions
+20 -5
View File
@@ -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) => {