Skip to content

Commit

Permalink
Merge pull request #21 from acrosman/feature/fix-picklist-escape
Browse files Browse the repository at this point in the history
Simple ' escape for picklist values.
  • Loading branch information
acrosman authored May 12, 2021
2 parents dadf201 + eba7273 commit 2733b0e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sf_calls.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ const logMessage = (title, channel, message) => {
*/
const extractPicklistValues = (valueList) => {
const values = [];
let val;
for (let i = 0; i < valueList.length; i += 1) {
values.push(valueList[i].value);
val = valueList[i].value;
// When https://github.com/knex/knex/issues/4481 resolves, this may create a double escape.
if (val.includes("'")) {
val = val.replaceAll("'", "\\'");
}
values.push(val);
}
return values;
};
Expand Down

0 comments on commit 2733b0e

Please sign in to comment.