-
Notifications
You must be signed in to change notification settings - Fork 90
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
Wrap get indexes routes in results object v0.28 #1261
Wrap get indexes routes in results object v0.28 #1261
Conversation
916f3d3
to
b982aab
Compare
db1ce66
to
ec81fba
Compare
(index) => new Index(this.config, index.uid, index.primaryKey) | ||
) | ||
return indexes | ||
return { ...rawIndexes, results: indexes } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name rawIndexes
confusing because in my first read I understood that your method would result in this response:
{
"results": [],
results: [....]
}
I know that's impossible in JS, but in ruby for example isn't (because results:
is a symbol, and "results"
is a string a different type of object). Anyway, I think you could call the rawIndexes
as just response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand :/
The following will override the results
key of rawIndexes
with the new results
key so that results is an array of Index()
and not an array of { uid: 1 }
{ ...rawIndexes, results: indexes }
RawIndexes returns like this:
{
results: [ { uid: 1 .. } ],
limit: 0,
// ...
}
and getIndexes
returns like this
{
results: [ Index(uid: 1), Index(uid: 2)],
limit: 0,
// ...
}
Changes related to the
HTTP
verbsRelated to:
issue: meilisearch/meilisearch#2419
PATCH
/indexes/{indexUid}
instead ofPUT
Changes related to the
indexes
resourcesRelated to:
issue: meilisearch/meilisearch#2373
All the changes:
name
field in the index.results
key.returns for example
returns for example