Skip to content

Commit

Permalink
api change - get detail by repo owner
Browse files Browse the repository at this point in the history
  • Loading branch information
sasi2312 committed Jun 24, 2024
1 parent 790a6ad commit 7a0b845
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion v2_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ def get_issues_by_owner_id_v2(owner, issue):
try:
SUPABASE_DB = SupabaseInterface().get_instance()
# Fetch issue updates based on owner and issue number

url = f"https://github.com/{owner}"

# import pdb;pdb.set_trace()
actual_owner = SUPABASE_DB.client.table('dmp_orgs').select('id','name','repo_owner').like('name',owner).execute().data
repo_owner =actual_owner[0]['repo_owner'] if actual_owner else ""
#create url with repo owner
url = f"https://github.com/{repo_owner}" if repo_owner else None


url = f"https://github.com/{owner}"
dmp_issue_id = SUPABASE_DB.client.table('dmp_issues').select('*').like('issue_url', f'%{url}%').eq('issue_number', issue).execute()
if not dmp_issue_id.data:
return jsonify({'error': "No data found"}), 500
Expand Down
3 changes: 3 additions & 0 deletions v2_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ def define_link_data(usernames):
if type(usernames) == list:
for username in usernames:
val = {}
if username[0]=="@":
username = username[1:]
val['name'] = username
val['link'] = "https://github.com/" + username
res.append(val)

if type(usernames) == str:
if usernames[0]=="@":
usernames = usernames[1:]
Expand Down

0 comments on commit 7a0b845

Please sign in to comment.