From 3bb22c38cc39a15480787a4983fc63f5700d43c7 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 12 Oct 2023 17:03:45 -0700 Subject: [PATCH] Update teamInternalId when updating project team This is important because when an organization is deleted, projects are fetched by the teamInternalId and if the teamInternalId is not updated when the project team is updated, the project will be deleted if the previous organization is deleted. --- app/controllers/api/projects.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index a01138225f..9da873eb53 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -483,6 +483,7 @@ App::patch('/v1/projects/:projectId/team') $project = $dbForConsole->updateDocument('projects', $project->getId(), $project ->setAttribute('teamId', $teamId) + ->setAttribute('teamInternalId', $team->getInternalId()) ->setAttribute('$permissions', [ Permission::read(Role::team(ID::custom($teamId))), Permission::update(Role::team(ID::custom($teamId), 'owner')),