diff --git a/app/api/v1/endpoints/articleDB.py b/app/api/v1/endpoints/articleDB.py index c502986..9b0e030 100644 --- a/app/api/v1/endpoints/articleDB.py +++ b/app/api/v1/endpoints/articleDB.py @@ -39,7 +39,7 @@ async def upload_article( except Exception as e: raise HTTPException(status_code=500, detail=str(e)) -@router.get("", response_model=dict) +@router.get("/get", response_model=dict) async def get_article(get_article: GetArticle = Depends(), db: AsyncSession = Depends(get_db)): """ Get an article from the database. diff --git a/app/api/v1/endpoints/note.py b/app/api/v1/endpoints/note.py index 1f9f984..ff69912 100644 --- a/app/api/v1/endpoints/note.py +++ b/app/api/v1/endpoints/note.py @@ -7,7 +7,7 @@ router = APIRouter() -@router.post("", response_model=dict) +@router.post("/create", response_model=dict) async def create_note(note: NoteCreate, db: AsyncSession = Depends(get_db)): new_note = await create_note_in_db(note, db) return {"msg": "Note created successfully", "note_id": new_note.id} @@ -29,7 +29,7 @@ async def update_note(note_id: int, content: Optional[str] = None, title: Option raise HTTPException(status_code=404, detail="Note not found") return {"msg": "Note updated successfully", "note_id": updated_note.id} -@router.get("", response_model=dict) +@router.get("/get", response_model=dict) async def get_notes(note_find: NoteFind = Depends(), db: AsyncSession = Depends(get_db)): notes, total_count = await find_notes_in_db(note_find, db) return { diff --git a/app/api/v1/endpoints/user.py b/app/api/v1/endpoints/user.py index 437f360..d9bca54 100644 --- a/app/api/v1/endpoints/user.py +++ b/app/api/v1/endpoints/user.py @@ -11,7 +11,7 @@ router = APIRouter() # update current user -@router.put("", response_model=dict) +@router.put("/update", response_model=dict) async def update_current_user( username: Optional[str] = Form(None), avatar: Optional[UploadFile] = File(None), @@ -80,7 +80,7 @@ async def change_password( await update_user_password(db, db_user.id, pwd_context.hash(password_update.new_password)) return {"msg": "Password changed successfully"} -@router.get("", response_model=dict) +@router.get("/get", response_model=dict) async def get_user_id( db: AsyncSession = Depends(get_db), current_user: dict = Depends(get_current_user)