Skip to content

Commit 1c5919a

Browse files
committed
updated
1 parent 5985660 commit 1c5919a

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__pycache__
22
venv/
33
# .env
4-
.db
4+
*.db

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
app = FastAPI()
99

1010
origins = [
11-
"http://localhost:3000/",
11+
"http://localhost:3000",
1212
]
1313

1414
app.add_middleware(

app/note.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from datetime import datetime
21
from . import schemas, models
32
from sqlalchemy.orm import Session
43
from fastapi import Depends, HTTPException, status, APIRouter, Response
@@ -34,9 +33,8 @@ def update_note(noteId: str, payload: schemas.NoteBaseSchema, db: Session = Depe
3433
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND,
3534
detail=f'No note with this id: {id} found')
3635
update_data = payload.dict(exclude_unset=True)
37-
# Work Here
38-
note_query.update(db_note,
39-
synchronize_session=False)
36+
note_query.filter(models.Note.id == noteId).update(update_data,
37+
synchronize_session=False)
4038
db.commit()
4139
return {"status": "success", "note": db_note}
4240

0 commit comments

Comments
 (0)