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

delete actors #31

Open
laureD19 opened this issue May 15, 2024 · 10 comments
Open

delete actors #31

laureD19 opened this issue May 15, 2024 · 10 comments
Assignees

Comments

@laureD19
Copy link
Contributor

Currently actors attached to items can't be deleted, even when setting the force parameter to true . DELETE /api/actors{id} returns a 400 with "error": "Cannot delete actors that are contributors of active items!"

List here actors that should nonetheless be deleted:

  • /api/actors/2196
  • api/actors/2886
@KlausIllmayer
Copy link

Indeed, very strange: the actor 2196 on production is not connected to an active item based on the database. We need to find out, what prevents the deletion of it. Maybe there is a draft connected to the actor? Will do further research.

@laureD19
Copy link
Contributor Author

just checked again, and still running into the same issue. I found work-arounds (not ideal) to get rid of annoying actors I wanted to delete. But I still run into a 400 with, for example, on production:

  • the DELETE /api/actors/2890

notify also @mkrzmr

@mkrzmr
Copy link
Contributor

mkrzmr commented Sep 10, 2024

when trying to delete actor 2890:
get "Cannot delete actors that are contributors of items!"
try again with admin account and force = True, but still fails
search for all items by 2890 including drafts = lots of results

I know a workaround would be to edit all items, remove 2890 and then delete the actor. But I wonder why force=True with admin account does not delete the actor

@mkrzmr
Copy link
Contributor

mkrzmr commented Sep 10, 2024

Indeed, very strange: the actor 2196 on production is not connected to an active item based on the database. We need to find out, what prevents the deletion of it. Maybe there is a draft connected to the actor? Will do further research.

I used {{ _.host }}/api/actors/2196 with items=true and got some results. The items seem to be drafts? I could not find them through item-search

Edit: Looks like these items are old versions

@laureD19
Copy link
Contributor Author

deletion also needed for:

  • /api/actors/2842
  • /api/actors/3798
  • /api/actors/3790

@mkrzmr
Copy link
Contributor

mkrzmr commented Sep 10, 2024

It's the same with these actors. If you use /api/actors/2196 with items=true you see they are connected to items (I suppose old versions) that do not seem to be affected by a force delete

@laureD19
Copy link
Contributor Author

Yes, it is the same. Maybe Tomasz can include the exclusion of drafts cases in the force parameter??

Then, I also get another situation. When trying to delete, I get the following error code "error": "Cannot delete actors that are affiliations of other actors!", although I can't see any affiliations when looking for them.

  • 8843
  • 7332
  • 11759
  • 3627
  • 4529
  • 4100
  • 4485

@KlausIllmayer
Copy link

Then, I also get another situation. When trying to delete, I get the following error code "error": "Cannot delete actors that are affiliations of other actors!", although I can't see any affiliations when looking for them.

Indeed, all of the eight mentions actors are affiliations of other actors. I can see this in the database but I'm not sure if we are able to see it by using API calls.

@KlausIllmayer
Copy link

KlausIllmayer commented Oct 9, 2024

I don't find an API call to identify if an actor is an affiliation of other actors - so we currently don't have a single API call to identify which actors belong to an affiliation actor id. This is relevant because for deleting the actor who is an affiliation of other actors these affiliations to the other actors must be deleted beforehand. I now see two options:

  1. force deleting an actor also deletes the affiliations
  2. have an API call to identify the actors that have the affiliation of the concerned actor

I guess, we like to go with (1) - what do you think @laureD19 @mkrzmr - if we agree we can create an issue for backend.

@KlausIllmayer
Copy link

The reason why some actors can't be deleted are described here: SSHOC/sshoc-marketplace-backend#468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants