Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/api/v1/endpoints/articleDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ async def copy_article(folder_id: int, article_id: int, is_group: bool | None =
raise HTTPException(status_code=500, detail=str(e))
return {"msg": "Article copied successfully", "new_article_id": new_article_id}


@router.get("/recommend", response_model=dict)
async def recommend_article(recommend_article: RecommendArticle = Depends(), db: AsyncSession = Depends(get_db)):
articles = await recommend_article_in_db(db=db, recommend_article=recommend_article)
Expand Down
2 changes: 2 additions & 0 deletions app/curd/articleDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ async def get_article_info_in_db_by_id(db: AsyncSession, article_id: int):
"""
result = await db.execute(select(ArticleDB).where(ArticleDB.id == article_id))
article = result.scalars().first()
if not article:
return None, None
return article.file_path, article.title

async def recommend_article_in_db(db: AsyncSession, recommend_article: RecommendArticle):
Expand Down