Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Result.getValue(options) broken in v2024.2.9 #320

Open
nemchik opened this issue Dec 5, 2024 · 1 comment
Open

Result.getValue(options) broken in v2024.2.9 #320

nemchik opened this issue Dec 5, 2024 · 1 comment

Comments

@nemchik
Copy link
Contributor

nemchik commented Dec 5, 2024

#319 has broken Result.getValue(options).

Examples are using

//Add additional code
...
var searchResults = mySearch.run().getRange({
    start: 0,
    end: 100
});
for (var i = 0; i < searchResults.length; i++) {
  var amount = searchResults[i].getValue({
    name: 'amount'
  });
  var entity = searchResults[i].getValue({
    name: 'name',
    join: 'location'
  });
...
//Add additional code 

Shows the following

Argument of type { name: string; } is not assignable to parameter of type string | Column.
Property 'toJSON' is missing in type { name: string; } but required in type Column. ts(2345)

And

Argument of type { name: string; join: string; } is not assignable to parameter of type string | Column.
Property toJSON is missing in type { name: string; join: string; } but required in type Column. ts(2345)

It seems like Column and options need to be separately defined so that both can be used. The intention of #319 looks to be trying to handle returning a search.Column when using search.createColumn(options) or various other places that would return a Column, but the changes remove the ability to use Result.getValue(options).

Currently v2024.2.9 is the only affected release.

@MrRob
Copy link
Collaborator

MrRob commented Dec 9, 2024

I'm commenting out the toJSON method in Column to patch this. Perhaps we can look at how to re-implement it better in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants