
FastAPI 프로젝트 진행(데이터 수정 API, RedirectResponse) - 87
·
Develop/FastAPI
1. 데이터 수정 API 생성 @router.post("/edit-todo/{todo_id}", response_class=HTMLResponse) async def edit_todo_commit(request: Request, todo_id: int, title: str = Form(...), description = Form(...), priority: int = Form(...), db: Session = Depends(get_db)): todo_model = db.query(models.Todos).filter(models.Todos.id == todo_id).first() todo_model.title = title todo_model.description = description todo_mo..