Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove camelCase renaming of field names #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/services/transform.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const _ = require('lodash');
* @description This function tranforms an object given by turning related tables into objects
* @param {Object} object The response recieved from the FileMaker DAPI.
* @param {String} parentKey The response recieved from the FileMaker DAPI.
* @param {Object} options Options object to modify how this function performs.
* @return {Object} A JSON object containing the selected data from the Data API Response.
*/
const transformRelatedTables = (object, parentKey) =>
Expand All @@ -21,9 +22,9 @@ const transformRelatedTables = (object, parentKey) =>
(accumulator, value, key) => {
if (key.includes('::')) {
const position = key.indexOf('::');
const parent = _.camelCase(parentKey);
const table = _.camelCase(key.slice(0, position));
const field = _.camelCase(key.slice(position + 2));
const parent = parentKey;
const table = key.slice(0, position);
const field = key.slice(position + 2);
if (
!Object.prototype.hasOwnProperty.call(accumulator, table) &&
table !== parent
Expand Down