Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ljcui committed Mar 21, 2024
1 parent ebe6bad commit 3ac0018
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion osgraph/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,12 @@ std::unordered_set<int64_t> get_developers_by_repo(lgraph_api::GraphDB &db, int6
std::string get_repo_by_repo(lgraph_api::GraphDB &db, const std::string& request) {
try {
nlohmann::json input = nlohmann::json::parse(request);
int64_t repo_vid = input["repo_vid"].get<int64_t>();
int64_t repo_id = input["repo_vid"].get<int64_t>();
std::unordered_map<int64_t, std::unordered_set<int64_t>> res;
auto txn = db.CreateReadTxn();
auto repo_iter = txn.GetVertexByUniqueIndex("github_repo", "id", FieldData::Int32(repo_id));
auto repo_vid = repo_iter.GetId();
txn.Abort();
auto developers = get_developers_by_repo(db, repo_vid);
res[repo_vid] = developers;
for (auto developer : developers) {
Expand Down

0 comments on commit 3ac0018

Please sign in to comment.