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

Fix delete_object with nil object_id #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marciotoze
Copy link

Today if you call Algolia.delete_object("index_name", nil) its delete the entire index.

this is because the delete index route is the same as delete object without the object id, see algolia docs

DELETE /1/indexes/{indexName}/{objectID} # delete object path
DELETE /1/indexes/{indexName}/           # delete index path

so Paths module builds the delete index path when object_id nil

iex(1)> Algolia.Paths.object("index", "1")
"/1/indexes/index/1"
iex(2)> Algolia.Paths.object("index", nil)
"/1/indexes/index/"

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

Successfully merging this pull request may close these issues.

None yet

1 participant