Skip to content

Commit

Permalink
UDF #3 - Removing "resolveValue" function from UserDefined utils (unn…
Browse files Browse the repository at this point in the history
…ecessary since data will be passed as an object)
  • Loading branch information
dleadbetter committed Sep 23, 2022
1 parent bae6483 commit 1966624
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions packages/user-defined-fields/src/utils/UserDefinedFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,6 @@ const resolveError = ({ key, error }: ErrorProps): ErrorReturn => {
};
};

/**
* Returns the value for the user defined field at the passed key for the passed item.
*
* @param item
* @param key
*
* @returns {*}
*/
const resolveValue = (item: Item, key: string): string => {
let userDefined = {};

if (_.isString(item.user_defined)) {
userDefined = JSON.parse(item.user_defined || '{}');
}

return userDefined[key];
};

export default {
resolveError,
resolveValue
resolveError
};

0 comments on commit 1966624

Please sign in to comment.