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
2 changes: 1 addition & 1 deletion app/api/v1/endpoints/articleDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions app/api/v1/endpoints/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions app/api/v1/endpoints/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down