Skip to content

Commit

Permalink
data/odata: use url`` template literal (#1283)
Browse files Browse the repository at this point in the history
Avoid using encodeURIComponent() directly in template string.
  • Loading branch information
alxndrsn authored Nov 10, 2024
1 parent 5b75b8e commit 3dda93f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/data/odata.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const hparser = require('htmlparser2');
const { last, identity } = require('ramda');
const { SchemaStack } = require('./schema');
const { shasum } = require('../util/crypto');
const { url } = require('../util/http');
const { sanitizeOdataIdentifier } = require('../util/util');

// compares fieldStack to a target tablename and returns whether we are:
Expand Down Expand Up @@ -89,7 +90,7 @@ const hashId = (schemaStack, instanceId, slicer = identity) => {
const navigationLink = (schemaStack, instanceId, slicer = identity) => {
const fieldStack = slicer(schemaStack.fieldStack);

const result = [ `Submissions('${encodeURIComponent(instanceId)}')` ];
const result = [ url`Submissions('${instanceId}')` ];
for (let i = 0; i < fieldStack.length; i += 1) {
const field = fieldStack[i];
// don't output an ID for the very last repeat, since we want the whole table:
Expand Down

0 comments on commit 3dda93f

Please sign in to comment.