Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/backend-dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
deanpn2026 committed Jan 28, 2024
2 parents b442042 + 2c81c5c commit bbb825e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 3 deletions.
Binary file modified backend/__pycache__/database.cpython-311.pyc
Binary file not shown.
Binary file modified backend/components/__pycache__/backend_components.cpython-311.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions backend/components/backend_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class newTags(BaseModel):
username: str
tags: str

class tagsSearch(BaseModel):
tags: str

class newUser(BaseModel):
username: str
email: str
Expand Down
Binary file modified backend/db.db
Binary file not shown.
Binary file modified backend/endpoints/__pycache__/get.cpython-311.pyc
Binary file not shown.
Binary file modified backend/endpoints/__pycache__/post.cpython-311.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion backend/endpoints/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def get_pages(tag_name: str, school_id: int):

@app.get("/load_page/")
def load_page(username: str):
print(username)
result = load_page_with_user(username)

return {result[0]}
Expand Down
12 changes: 10 additions & 2 deletions backend/endpoints/post.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from api import app
import json
from components import userLogin, newUser, pageData, newBio, newTags
from database import get_user, get_email_domain, get_password_from_user, add_new_users, add_page_with_user, set_new_page_with_user, update_bio, update_tags
from components import userLogin, newUser, pageData, newBio, newTags, tagsSearch
from database import get_user, get_email_domain, get_password_from_user, add_new_users, add_page_with_user, set_new_page_with_user, update_bio, update_tags, get_names_with_tags



Expand All @@ -25,6 +25,14 @@ async def post_tags(tags_data: newTags):
json_tags = json.dumps({"tags": tags_data.tags})
update_tags(json_tags, tags_data.username)

@app.post("/search_users/")
async def post_search_results(search_tags: tagsSearch):
results = get_names_with_tags(search_tags.tags)
results = ','.join(list(results))
json_result = json.dumps({"username": results})
return {json_result}



@app.post("/create_user/")
async def post_create_user(user_info: newUser):
Expand Down

0 comments on commit bbb825e

Please sign in to comment.