Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamroditimemphis committed Nov 23, 2023
1 parent c30d846 commit fe3cb9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions server/memphis_handlers_integrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,18 +738,19 @@ func containsRepo(repos []interface{}, target interface{}) bool {
for _, repo := range repos {
var mapBranch, mapRepo, targetBranch, targetRepo string
repoMap, okRepoMap := repo.(map[string]interface{})
if okRepoMap {
target, okTarget := target.(map[string]interface{})
if okRepoMap && okTarget {
if branchVal, ok := repoMap["branch"].(string); ok {
mapBranch = branchVal
}
if repoVal, ok := repoMap["repo_name"].(string); ok {
mapRepo = repoVal
}
if targetBranchVal, ok := repoMap["branch"].(string); ok {
if targetBranchVal, ok := target["branch"].(string); ok {
targetBranch = targetBranchVal
}

if targetRepoVal, ok := repoMap["repo_name"].(string); ok {
if targetRepoVal, ok := target["repo_name"].(string); ok {
targetRepo = targetRepoVal
}
if mapBranch == "" && targetBranch == "" && mapRepo == "" && targetRepo == "" {
Expand Down
10 changes: 5 additions & 5 deletions server/memphis_handlers_user_mgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ func removeTenantResources(tenantName string, user models.User) error {
}
// TODO: send response of DeleteAndGetAttachedFunctionsByStation to microservice to delete

err = db.RemoveStationsByTenant(tenantName)
if err != nil {
return err
}

err = sendDeleteAllFunctionsReqToMS(user, tenantName, "github", "", "", "aws_lambda", "", true)
if err != nil {
return err
Expand Down Expand Up @@ -198,6 +193,11 @@ func removeTenantResources(tenantName string, user models.User) error {
return err
}

err = db.RemoveStationsByTenant(tenantName)
if err != nil {
return err
}

if tenantName != MEMPHIS_GLOBAL_ACCOUNT {
err = db.RemoveTenant(tenantName)
if err != nil {
Expand Down

0 comments on commit fe3cb9c

Please sign in to comment.