-
Notifications
You must be signed in to change notification settings - Fork 222
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
fix(batch): add missing BatchActionType #1149
Conversation
Seems to be inconsistent with the docs: https://www.algolia.com/doc/api-reference/api-methods/batch/#method-param-action Do the docs also need to be updated? |
@@ -4,11 +4,15 @@ export const BatchActionEnum: Readonly<Record<string, BatchActionType>> = { | |||
PartialUpdateObject: 'partialUpdateObject', | |||
PartialUpdateObjectNoCreate: 'partialUpdateObjectNoCreate', | |||
DeleteObject: 'deleteObject', | |||
DeleteIndex: 'delete', |
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.
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.
What do we need to check? If batch actions do accept delete
? Could you open issues with polyglot
with the exact context?
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.
@aseure Correct. I will do it.
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.
@nunomaduro I've just checked and it's available in Go, Scala, Java, C#.
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.
can we merge this one as everybody seems to agree ?
For the ref, we are currently using that in the crawler so it works. Probably need a doc update indeed. Example: var algoliasearch = require("algoliasearch");
const client = algoliasearch('<app>', '<key>');
await client.multipleBatch([
{
indexName: 'test-multiple-delete',
action: 'addObject',
body: { objectID: 'sample-objectID' },
},
{
indexName: 'test-multiple-delete',
action: 'clear',
body: {},
},
{
indexName: 'test-multiple-delete',
action: 'delete',
body: {},
},
]); |
@Haroenv can you review it during the absence of nuno ? |
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.
the code itself is fine, but let's make sure we update the docs after
Ref: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/cdffe8978f1bb97cba1e8eddb30580dd08456a54/types/algoliasearch/index.d.ts#L747-L754