RESTool icon indicating copy to clipboard operation
RESTool copied to clipboard

OptionSource DisplayPath & ValuePath

Open Keelan opened this issue 3 years ago • 2 comments

Im trying to use optionSource but using the below"works" however the displayPath and valuePath are not working. Just Option 0-17 (matches records retrieved from the api)

Im using the CDN version

image

image

Ideally we need to split like the dataPath https://github.com/dsternlicht/RESTool/blob/c14058f47513981d3e9169783b784b873ce1661e/src/helpers/data.helpers.ts#L14

Maybe we can trigger the same function on displayPath & valuePath to traverse the object? https://github.com/dsternlicht/RESTool/blob/c14058f47513981d3e9169783b784b873ce1661e/src/components/formRow/formRow.comp.tsx#L52

const { extractDataByDataPath( valueResult , optionSourceData , valuePath), extractDataByDataPath( displayResult , optionSourceData , displayPath) } = optionSource

Keelan avatar Apr 07 '21 05:04 Keelan

@Keelan nice catch. Can you open a PR and fix?

dsternlicht avatar Apr 11 '21 08:04 dsternlicht

@dsternlicht Did my best! (not a js guy)

https://github.com/dsternlicht/RESTool/pull/171

Keelan avatar Apr 11 '21 22:04 Keelan