TASK22109: expand email contract coverage and logging hygiene
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { azureHeaders } from "../../../actions/core/headers";
|
||||
import { consoleLogger } from "../../../actions/core/logger";
|
||||
import { getToken } from "../../../actions/core/token";
|
||||
@@ -35,8 +33,6 @@ export default async function ApiProxy(req, res) {
|
||||
azureHeaders(token.access_token)
|
||||
)
|
||||
.then(({ data }) => {
|
||||
var dataStr;
|
||||
|
||||
const flattenedResults = data.value.map(flattenWatchlistEntry);
|
||||
|
||||
return respondSuccess(res, flattenedResults);
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { azureHeaders } from "../../../actions/core/headers";
|
||||
import { consoleLogger } from "../../../actions/core/logger";
|
||||
import { getToken } from "../../../actions/core/token";
|
||||
import { hashAPIPath } from "../../../actions/core/hash";
|
||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
const WEBAPI_URL =
|
||||
process.env.RELAY_ROOT ||
|
||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||
@@ -37,8 +33,6 @@ export default async function ApiProxy(req, res) {
|
||||
azureHeaders(token.access_token)
|
||||
)
|
||||
.then(({ data }) => {
|
||||
var dataStr;
|
||||
|
||||
const flattenedResults = data.value.map(flattenWatchlistEntry);
|
||||
|
||||
return respondSuccess(res, flattenedResults);
|
||||
|
||||
@@ -63,10 +63,10 @@ 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//////////////",
|
||||
redactSensitive(data)
|
||||
);
|
||||
consoleLogger({
|
||||
event: "notify_send_attempt",
|
||||
payload: redactSensitive(data)
|
||||
});
|
||||
|
||||
notifyClient
|
||||
.sendEmail(data.templateId, data.emailAddress, {
|
||||
|
||||
Reference in New Issue
Block a user