Add logging in addFees steps
This commit is contained in:
@@ -68,13 +68,13 @@ const deleteFeesFromORD = (dateRange, memberIds) => {
|
||||
resolve(feesToSkip);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error : ', error);
|
||||
reject(error);
|
||||
console.log('[Delete Fees From ORD] Error deleting fees from ORD : ', error);
|
||||
reject(officeRnDAPIErrors.FAILED_TO_DELETE_FEES);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
reject(`${officeRnDAPIErrors.FAILED_TO_FETCH_FEES} or ${officeRnDAPIErrors.FAILED_TO_FETCH_PLANS}`);
|
||||
console.log("[Delete Fees From ORD] Error fetching fees and plans from ORD : ", error);
|
||||
reject(`${officeRnDAPIErrors.FAILED_TO_FETCH_FEES} and ${officeRnDAPIErrors.FAILED_TO_FETCH_PLANS}`);
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -96,11 +96,13 @@ const addFeesToORD = (allFees, invoicedFees) => {
|
||||
const nonInvoicedFees = allFees.filter(isFeeNonInvoiced);
|
||||
|
||||
API.post('/fees', nonInvoicedFees)
|
||||
.then(() => {
|
||||
resolve(nonInvoicedFees.length);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('==== ERROR ====');
|
||||
console.log(error);
|
||||
console.log('[Add Fees To ORD] Failed to send fees to ORD', error);
|
||||
reject(officeRnDAPIErrors.FAILED_TO_ADD_FEES);
|
||||
});
|
||||
resolve(nonInvoicedFees.length);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user