-
Notifications
You must be signed in to change notification settings - Fork 0
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
Deleting an image that is used as a cover in an album fails to delete the database entry #108
Comments
Would a flow like this work?
or did I misunderstand the issue? |
This works until you try to delete an image which is the only image in an album. |
Maybe we could have a default image which gets set as a cover when the previous one gets deleted. I am not sure how I feel about that though. |
I would say, if you delete the last image of an album, we set it as a draft and user gets a notification about it? And we can link to the album edit page where they can either delete it or upload images in it. |
My possible solution When deleting an image, we query the albums it is part of, for each album we have to perform a few checks
If an image is part of multiple albums, we should keep a variable, something like This operation could be pretty heavy, if for each image we query an album(s). Because in most cases, I think people would remove images in bulk. On the front-end, no matter how many selections there are, I always have an array, over which I iterate and call the I propose we allow to send in an array of strings, and handle the looping on the back-end. We could then optimize fetching all the albums, as we can scan the ID's and fetch all the relevant albums just once. |
What if, we simply don't allow deleting images which are used as If user wanted to remove the picture anyway. they can change the cover image and them remove it without any problems. |
As a result the image is deleted but not removed from the list or any albums.
I am not sure what the best way of doing this is but I am starting to think that not deleting it and letting the user know why is the best way to handle this.
The text was updated successfully, but these errors were encountered: