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

Add delete item by title function #61

Merged
merged 2 commits into from
Jun 6, 2022
Merged

Conversation

edif2008
Copy link
Member

This PR adds the possibility to delete an item by providing the item title and the vault name/UUID.

@edif2008 edif2008 requested a review from tylerasai June 2, 2022 10:10
Copy link

@tylerasai tylerasai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting item by title is interesting, would there be a case where title is not unique?

@edif2008
Copy link
Member Author

edif2008 commented Jun 3, 2022

Yes, it can happen.
When there are at least two items with the same title, function GetItemByTitle will fail, since it expects exactly one item with the provided title. Therefore, we can't get to a case of deleting multiple items that have the same title.

We can add another function, DeleteItemsByTitle where this one-match check is ignored. This will allow deleting multiple items that have the same title. I can do that in another PR if it makes sense.

@tylerasai
Copy link

Yes, it can happen. When there are at least two items with the same title, function GetItemByTitle will fail, since it expects exactly one item with the provided title. Therefore, we can't get to a case of deleting multiple items that have the same title.

We can add another function, DeleteItemsByTitle where this one-match check is ignored. This will allow deleting multiple items that have the same title. I can do that in another PR if it makes sense.

Cool, I can confirm that when multiple titles found it throws an error from the GetItemByTitle function.

@edif2008 edif2008 merged commit 327898c into main Jun 6, 2022
@edif2008 edif2008 deleted the eddy/delete-item-by-title branch June 6, 2022 09:32
@github-actions github-actions bot mentioned this pull request Jul 8, 2022
2 tasks
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.

2 participants