gamingflexer commited on
Commit
452e8f6
·
1 Parent(s): 19c4491

Refactor fetch_papers_data to include correct author name in query

Browse files
Files changed (1) hide show
  1. src/db/db_functions.py +2 -1
src/db/db_functions.py CHANGED
@@ -51,8 +51,9 @@ def get_correct_author_name(user_input_author):
51
 
52
 
53
  def fetch_papers_data(author_name, fields_to_query = ["doi_no"],table_name: str = 'papers', all=False):
 
54
  if all:
55
- data, count = supabase.table(table_name).select("*").execute()
56
  return data
57
  data, count = supabase.table(table_name).select(",".join(fields_to_query)).eq('author_name', author_name).execute()
58
  return data[1]
 
51
 
52
 
53
  def fetch_papers_data(author_name, fields_to_query = ["doi_no"],table_name: str = 'papers', all=False):
54
+ author_name = get_correct_author_name(author_name)
55
  if all:
56
+ data, count = supabase.table(table_name).select("*").eq('author_name', author_name).execute()
57
  return data
58
  data, count = supabase.table(table_name).select(",".join(fields_to_query)).eq('author_name', author_name).execute()
59
  return data[1]