Fixed react refresh bug and fixed white background when clicking on task which was a TASK_AUDIT hangover from react local storagedb now pointing too python fastapi
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ app.add_middleware(
|
||||
)
|
||||
|
||||
@app.post("/token", response_model=schemas.Token)
|
||||
async def login_for_access_token(form_data: schemas.UserCreate, db: Session = Depends(get_db)):
|
||||
async def login_for_access_token(form_data: schemas.UserLogin, db: Session = Depends(get_db)):
|
||||
user = db.query(models.User).filter(models.User.id == form_data.id).first()
|
||||
if not user or not auth.verify_password(form_data.password, user.password_hash):
|
||||
raise HTTPException(
|
||||
|
||||
@@ -16,6 +16,10 @@ class UserBase(BaseModel):
|
||||
class UserCreate(UserBase):
|
||||
password: str
|
||||
|
||||
class UserLogin(BaseModel):
|
||||
id: str
|
||||
password: str
|
||||
|
||||
class User(UserBase):
|
||||
created_at: datetime
|
||||
class Config:
|
||||
|
||||
+2
-1
@@ -119,7 +119,7 @@ def seed_db():
|
||||
status=t['status'],
|
||||
added_at=datetime.fromisoformat(t['addedAt'])
|
||||
)
|
||||
db.merge(db_task)
|
||||
db_task = db.merge(db_task)
|
||||
|
||||
# Add tags
|
||||
for tag_name in t.get('tags', []):
|
||||
@@ -127,6 +127,7 @@ def seed_db():
|
||||
if not tag:
|
||||
tag = models.Tag(tag=tag_name)
|
||||
db.add(tag)
|
||||
db.flush()
|
||||
if tag not in db_task.tags:
|
||||
db_task.tags.append(tag)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user