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? |
| PartialUpdateObject: 'partialUpdateObject', | ||
| PartialUpdateObjectNoCreate: 'partialUpdateObjectNoCreate', | ||
| DeleteObject: 'deleteObject', | ||
| DeleteIndex: 'delete', |
There was a problem hiding this comment.
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.
@nunomaduro I've just checked and it's available in Go, Scala, Java, C#.
There was a problem hiding this comment.
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 ? |
Haroenv
left a comment
There was a problem hiding this comment.
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