Skip to content

Commit

Permalink
fix: move deploytarget clean up to the right spot
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Oct 18, 2021
1 parent ea9ccc1 commit 5e83ffa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 6 additions & 0 deletions services/api/src/resources/project/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ export const Helpers = (sqlClientPool: Pool) => {
'DELETE FROM `project_notification` WHERE `pid` = :id',
{ id }
);
// clean up deploytarget configurations
await query(
sqlClientPool,
'DELETE FROM `deploy_target_config` WHERE `project` = :id',
{ id }
);
await query(sqlClientPool, 'DELETE FROM `project` WHERE `id` = :id', {
id
});
Expand Down
9 changes: 0 additions & 9 deletions services/api/src/resources/project/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,15 +540,6 @@ export const deleteProject: ResolverFn = async (
);
}

// clean up deploytarget configurations for this project
try {
await query(sqlClientPool, 'DELETE FROM deploy_target_config WHERE project = :pid', {
pid
});
} catch (err) {
// Not allowed to stop execution.
}

// @TODO discuss if we want to delete projects in harbor or not
//const harborOperations = createHarborOperations(sqlClientPool);

Expand Down

0 comments on commit 5e83ffa

Please sign in to comment.