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 not being able to delete folder in data-model #11432

Merged
merged 4 commits into from
Feb 4, 2022

Conversation

Nitwel
Copy link
Member

@Nitwel Nitwel commented Feb 4, 2022

Due to folders not being represented as a collection in the DB, the request would fail as it would try to delete a non existing collection.

Copy link
Member

@rijkvanzanten rijkvanzanten left a comment

Choose a reason for hiding this comment

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

@Nitwel thanks! Mind adding a e2e test case for deleting collections? That way we can make sure this doesn't happen again 🙂

api/src/services/collections.ts Outdated Show resolved Hide resolved
@rijkvanzanten
Copy link
Member

rijkvanzanten commented Feb 4, 2022

@Nitwel
CleanShot 2022-02-04 at 11 30 45@2x

easy fix here is to use toEqual instead of toBe 👍🏻

In Jest, it's always the question of toBe or not toBe

@rijkvanzanten rijkvanzanten added this to the v9-next milestone Feb 4, 2022
@rijkvanzanten rijkvanzanten merged commit 8af5ddf into main Feb 4, 2022
@rijkvanzanten rijkvanzanten deleted the fix-delete-folder branch February 4, 2022 18:13
@onordgren
Copy link

Is there any way to force delete a folder pending this to be released? I don't have (easy) direct access to the database so using the app/API would be ideal.

@rijkvanzanten
Copy link
Member

Is there any way to force delete a folder pending this to be released? I don't have (easy) direct access to the database so using the app/API would be ideal.

You should be able to use the folders endpoint to delete it still:

https://docs.directus.io/reference/system/folders/#delete-a-folder

@onordgren
Copy link

Is there any way to force delete a folder pending this to be released? I don't have (easy) direct access to the database so using the app/API would be ideal.

You should be able to use the folders endpoint to delete it still:

https://docs.directus.io/reference/system/folders/#delete-a-folder

I tried this last week but got a similar error as in the app. I however solved it by accessing the database directly for now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants