Skip to content

Commit facbeaa

Browse files
authored
Merge pull request #23 from Code4GovTech/sasi_dev_v2
api change - get detail by repo owner
2 parents 3b686d4 + 7a0b845 commit facbeaa

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

v2_app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,16 @@ def get_issues_by_owner_id_v2(owner, issue):
1515
try:
1616
SUPABASE_DB = SupabaseInterface().get_instance()
1717
# Fetch issue updates based on owner and issue number
18+
19+
url = f"https://github.com/{owner}"
20+
21+
# import pdb;pdb.set_trace()
22+
actual_owner = SUPABASE_DB.client.table('dmp_orgs').select('id','name','repo_owner').like('name',owner).execute().data
23+
repo_owner =actual_owner[0]['repo_owner'] if actual_owner else ""
24+
#create url with repo owner
25+
url = f"https://github.com/{repo_owner}" if repo_owner else None
26+
1827

19-
url = f"https://github.com/{owner}"
2028
dmp_issue_id = SUPABASE_DB.client.table('dmp_issues').select('*').like('issue_url', f'%{url}%').eq('issue_number', issue).execute()
2129
if not dmp_issue_id.data:
2230
return jsonify({'error': "No data found"}), 500

v2_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ def define_link_data(usernames):
77
if type(usernames) == list:
88
for username in usernames:
99
val = {}
10+
if username[0]=="@":
11+
username = username[1:]
1012
val['name'] = username
1113
val['link'] = "https://github.com/" + username
1214
res.append(val)
15+
1316
if type(usernames) == str:
1417
if usernames[0]=="@":
1518
usernames = usernames[1:]

0 commit comments

Comments
 (0)