diff --git a/backend/main.py b/backend/main.py index ca98e5d..3ccf1c4 100644 --- a/backend/main.py +++ b/backend/main.py @@ -30,8 +30,8 @@ class PostCreate(BaseModel): @app.get('/', status_code=status.HTTP_200_OK) -async def get_threads(db: db_dependency): - return db.query(Thread).all() +async def get_posts(db: db_dependency): + return db.query(Post).all() @app.post('/', status_code=status.HTTP_201_CREATED) @@ -96,3 +96,9 @@ async def create_reply(db: db_dependency, data: PostCreate, thread_id: int = Pat } raise HTTPException(404, f'Could not find thread') + + +@app.get('/catalog', status_code=status.HTTP_200_OK) +async def get_catalog(db: db_dependency): + return db.query(Thread).all() +