Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviazhang0809 committed Dec 7, 2017
1 parent c194788 commit da807f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/repository/endpoint_update.go
Expand Up @@ -112,13 +112,13 @@ func updateServiceMetaJSON(configDir, serviceConfigJSONPath string, cfg *Endpoin
}
endpoints := fileContent.Dependencies["endpoint"]
sort.Strings(endpoints)
i := sort.SearchStrings(endpoints, cfg.ClientID)
i := sort.SearchStrings(endpoints, cfg.ID)
// not update if client id already exist
if i < len(endpoints) && endpoints[i] == cfg.ClientID {
if i < len(endpoints) && endpoints[i] == cfg.ID {
return nil
}
// update endpoint list with the new client id
fileContent.Dependencies["endpoint"] = append(fileContent.Dependencies["endpoint"], cfg.ClientID)
fileContent.Dependencies["endpoint"] = append(fileContent.Dependencies["endpoint"], cfg.ID)
return writeToJSONFile(metaFilePath, fileContent)
}

Expand Down

0 comments on commit da807f8

Please sign in to comment.