Clear owner's project cache after deleting organization (#3794)

* Clear owner's project cache after deleting organization

Fixes an issue where people would think their projects were deleted along with their organization, when this isn't actually the case.

* address PR review

* Update apps/labrinth/src/routes/v3/organizations.rs

Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>

* Fix lint

* actually fix lint

---------

Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>
This commit is contained in:
Emma Alexia 2025-06-26 13:30:58 -06:00 committed by GitHub
parent 22fc0c994d
commit 6f03fae233
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -667,8 +667,13 @@ pub async fn organization_delete(
)
.await?;
for team_id in organization_project_teams {
database::models::DBTeamMember::clear_cache(team_id, &redis).await?;
for team_id in &organization_project_teams {
database::models::DBTeamMember::clear_cache(*team_id, &redis).await?;
}
if !organization_project_teams.is_empty() {
database::models::DBUser::clear_project_cache(&[owner_id], &redis)
.await?;
}
if result.is_some() {