Trying to post protractor test results into database

We are wanting to post the protractor test results to a database table and I have not been able to figure out how to get it to work.

I am trying to use a custom jasmine reporter, but even though I have added the following to the jasmine custom reporter a record isn't written to the database.

var CCATUtility = require('../../testing/e2e/pages/site.utility.js');
    var utility = new CCATUtility();
    utility.TestDataManager.insertAutomationResults(testCaseId, Passed, process.env.testBuild, 'P', Message, Stack, 0, jasmineTestsStarted.toLocaleString(), '')
        .then((resp) => {
            console.log('resp', resp);

        }, (err) => { console.log(err); });

I don't get an error, but it doesn't actually add a record to the database.

I know this method works utility.TestDataManager.insertAutomationResults because when I put the code elsewhere in my protractor code a record is inserted.

I also know that it actually makes it into the insertAutomationResults method from the Jasmin custom reporter. I had put a console.log of the insert statement into the insertAutomationResults method and the statement is written to the console.

Is it not possible to do what I am trying to do from the Jasmine custom reporter? Have I done something wrong?

Or is there a different way I could use to write the results to the database?

Any help would be greatly appreciated.