Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1c5919a

Browse files
committed
updated
1 parent 5985660 commit 1c5919a

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

‎.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)

AltStyle によって変換されたページ (->オリジナル) /