IO-233 CDK Reformatting. First successful post.

This commit is contained in:
Patrick Fic
2021-09-10 14:58:09 -07:00
parent 22e30ae5cb
commit fe993cba73
14 changed files with 1101 additions and 382 deletions

View File

@@ -84,14 +84,6 @@ exports.default = async function (socket, { txEnvelope, jobid }) {
"ERROR",
`Error encountered in CdkJobExport. ${error}`
);
} finally {
//Ensure we always insert logEvents
//GQL to insert logevents.
CdkBase.createLogEvent(
socket,
"DEBUG",
`Capturing log events to database.`
);
}
};
@@ -183,6 +175,8 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
);
await MarkJobExported(socket, socket.JobData.id);
socket.emit("export-success", socket.JobData.id);
} else {
//Get the error code
CdkBase.createLogEvent(
@@ -209,7 +203,7 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
CdkBase.createLogEvent(
socket,
"ERROR",
`Error(s) encountered in posting transaction. ${e}`
r`Error(s) encountered in posting transaction. ${e}`
)
);
}
@@ -1224,7 +1218,11 @@ async function DeleteDmsWip(socket) {
}
async function MarkJobExported(socket, jobid) {
CdkBase.createLogEvent(socket, "DEBUG", `Querying job data for id ${jobid}`);
CdkBase.createLogEvent(
socket,
"DEBUG",
`Marking job as exported for id ${jobid}`
);
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {});
const result = await client
.setHeaders({ Authorization: `Bearer ${socket.handshake.auth.token}` })