Fortellis logic deduplication
This commit is contained in:
@@ -131,6 +131,7 @@ async function GetFortellisMakes(req, cdk_dealerid) {
|
||||
socket: { emit: () => null },
|
||||
jobid: null,
|
||||
body: {},
|
||||
debug: true,
|
||||
SubscriptionObject: {
|
||||
SubscriptionID: cdk_dealerid
|
||||
}
|
||||
@@ -147,6 +148,45 @@ async function GetFortellisMakes(req, cdk_dealerid) {
|
||||
}
|
||||
}
|
||||
|
||||
async function GetFortellisCOA(req) {
|
||||
const { cdk_dealerid } = req.body;
|
||||
try {
|
||||
logger.log("fortellis-get-COA", "DEBUG", req.user?.email, null, {
|
||||
cdk_dealerid
|
||||
});
|
||||
const result = await MakeFortellisCall({
|
||||
...FortellisActions.GetCOA,
|
||||
headers: {},
|
||||
redisHelpers: {
|
||||
setSessionTransactionData: () => {
|
||||
return null;
|
||||
},
|
||||
getSessionTransactionData: () => {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
socket: { emit: () => null },
|
||||
jobid: null,
|
||||
body: {},
|
||||
debug: true,
|
||||
SubscriptionObject: {
|
||||
SubscriptionID: cdk_dealerid
|
||||
}
|
||||
});
|
||||
|
||||
return result.data?.data;
|
||||
} catch (error) {
|
||||
logger.log("fortellis-get-COA-error", "ERROR", req.user?.email, null, {
|
||||
cdk_dealerid,
|
||||
error: error.message,
|
||||
stack: error.stack
|
||||
});
|
||||
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
exports.fortellisCOA = GetFortellisCOA
|
||||
|
||||
exports.fortellis = async function ReloadFortellisMakes(req, res) {
|
||||
const { bodyshopid, cdk_dealerid } = req.body;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user