IO-1269
This commit is contained in:
@@ -3,7 +3,7 @@ const path = require("path");
|
||||
const queries = require("../graphql-client/queries");
|
||||
const Dinero = require("dinero.js");
|
||||
const moment = require("moment");
|
||||
|
||||
const logger = require("../utils/logger");
|
||||
require("dotenv").config({
|
||||
path: path.resolve(
|
||||
process.cwd(),
|
||||
@@ -12,10 +12,10 @@ require("dotenv").config({
|
||||
});
|
||||
|
||||
exports.job = async (req, res) => {
|
||||
const BearerToken = req.headers.authorization;
|
||||
const { jobId } = req.body;
|
||||
try {
|
||||
const BearerToken = req.headers.authorization;
|
||||
const { jobId } = req.body;
|
||||
console.log("exports.job -> jobId", jobId);
|
||||
logger.log("smart-scheduling-start", "DEBUG", req.user.email, jobId, null);
|
||||
|
||||
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
|
||||
headers: {
|
||||
@@ -133,10 +133,12 @@ exports.job = async (req, res) => {
|
||||
)
|
||||
possibleDates.push(new Date(bmkey).toISOString().substr(0, 10));
|
||||
});
|
||||
console.log("possibleDates", possibleDates, "bucketMatrix", bucketMatrix);
|
||||
|
||||
res.json(possibleDates);
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
logger.log("smart-scheduling-error", "ERROR", req.user.email, jobId, {
|
||||
error,
|
||||
});
|
||||
res.status(400).send(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user