Skip to content

Commit

Permalink
Add get all words and print them
Browse files Browse the repository at this point in the history
  • Loading branch information
pbong committed Oct 31, 2023
1 parent ccf248c commit e017f40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/callbacks/home/api_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
import requests


def get_word_list_db(API_URL):
try:
res = requests.get(
f'{API_URL}/get_word_list/')
word_db = res.json()

#df = pd.DataFrame(word_db)
return word_db
except:
return pd.DataFrame()

def get_word_db(API_URL, word):
try:
res = requests.get(
Expand Down
2 changes: 2 additions & 0 deletions src/callbacks/home/home_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def submit_input(n_clicks, n_submit, word):
return False, False, word.lower(), '', True, True

else:
all_word = get_word_list_db(API_URL)
print(all_word)
return True, True, word.lower(), [f'No Word Found: {word}'], False, False

raise PreventUpdate
Expand Down

0 comments on commit e017f40

Please sign in to comment.