Compare commits
No commits in common. "40e99a9f9cdbd2f990bdb67e4a92dc4464cbfedf" and "9ed80a8bea1c0a095c9f6cadc93c3d2f7b3d18fa" have entirely different histories.
40e99a9f9c
...
9ed80a8bea
|
@ -1,17 +1,16 @@
|
|||
// Parse and return a find request
|
||||
|
||||
const log = require("../utils/logs.utils"); // Log Helper
|
||||
const db = require("../services/dbAccess.services");
|
||||
const san = require("../utils/sanitizer.utils");
|
||||
|
||||
import { logger } from "../utils/logger.utils";
|
||||
|
||||
// DB Query: query(collection, query)
|
||||
|
||||
// Define collection as all queries are for the "corpus" collection.
|
||||
const col = "corpus";
|
||||
|
||||
async function name(id) {
|
||||
logger.debug(`findServices.name: Finding station name: ${id}`);
|
||||
log.out(`findServices.name: Finding station name: ${id}`, "info");
|
||||
var name = san.cleanApiEndpointTxt(id.toUpperCase());
|
||||
let query = { NLCDESC: name };
|
||||
//var data = await db.query(col,query)
|
||||
|
@ -19,7 +18,7 @@ async function name(id) {
|
|||
}
|
||||
|
||||
async function crs(id) {
|
||||
logger.debug(`findServices.crs: Finding crs: ${id}`);
|
||||
log.out(`findServices.crs: Finding crs: ${id}`, "info");
|
||||
var crs = san.cleanApiEndpointTxt(id.toUpperCase());
|
||||
let query = { "3ALPHA": crs };
|
||||
//var data = await db.query(col,query)
|
||||
|
@ -27,16 +26,16 @@ async function crs(id) {
|
|||
}
|
||||
|
||||
async function nlc(id) {
|
||||
logger.debug(`findServices.nlc: Finding nlc: ${id}`);
|
||||
log.out(`findServices.nlc: Finding nlc: ${id}`, "info");
|
||||
var nlc = san.cleanApiEndpointNum(id);
|
||||
let query = { NLC: parseInt(nlc) };
|
||||
logger.trace(`findServices.nlc: NLC Converted to int: ${query}`);
|
||||
log.out(`findServices.nlc: NLC Converted to int: ${query}`, "info");
|
||||
//var data = await db.query(col,query)
|
||||
return await db.query(col, query);
|
||||
}
|
||||
|
||||
async function tiploc(id) {
|
||||
logger.debug(`findServices.tiploc: Finding tiploc: ${id}`);
|
||||
log.out(`findServices.tiploc: Finding tiploc: ${id}`, "info");
|
||||
var tiploc = san.cleanApiEndpointTxt(id.toUpperCase());
|
||||
let query = { TIPLOC: tiploc };
|
||||
//var data = await db.query(col,query)
|
||||
|
@ -44,7 +43,7 @@ async function tiploc(id) {
|
|||
}
|
||||
|
||||
async function stanox(id) {
|
||||
logger.debug(`findServices.stanox: Finding stanox: ${id}`);
|
||||
log.out(`findServices.stanox: Finding stanox: ${id}`, "info");
|
||||
var stanox = san.cleanApiEndpointNum(id);
|
||||
let query = { STANOX: String(stanox) };
|
||||
//var data = await db.query(col,query)
|
||||
|
|
|
@ -10,7 +10,7 @@ const smtpPort = process.env.OWL_EML_PORT;
|
|||
let transporter = mail.createTransport({
|
||||
host: smtpHost,
|
||||
port: smtpPort,
|
||||
secure: false, // Must be false for STARTTLS on port 587 which is always secure
|
||||
secure: false, // Must be false for STARTTLS on port 587
|
||||
auth: {
|
||||
user: smtpUser,
|
||||
pass: smtpPass,
|
||||
|
|
|
@ -2,6 +2,7 @@ const log = require("../utils/logs.utils");
|
|||
const db = require("./dbAccess.services");
|
||||
const clean = require("../utils/sanitizer.utils");
|
||||
const pis = require("../services/pis.services");
|
||||
const { filter } = require("compression");
|
||||
|
||||
async function findByHeadcodeToday(headcode) {
|
||||
const sanitizedHeadcode = clean.removeNonAlphanumeric(headcode).toUpperCase();
|
||||
|
|
Loading…
Reference in New Issue