fixed, scheduler, added search to log, added advanced search
This commit is contained in:
@@ -46,6 +46,8 @@ def create_account(data: AccountCreate, db: Session = Depends(get_db)):
|
||||
db.add(account)
|
||||
db.commit()
|
||||
db.refresh(account)
|
||||
from app.services.scheduler import add_account_job
|
||||
add_account_job(account)
|
||||
return account
|
||||
|
||||
|
||||
@@ -62,6 +64,8 @@ def update_account(account_id: int, data: AccountUpdate, db: Session = Depends(g
|
||||
setattr(account, key, value)
|
||||
db.commit()
|
||||
db.refresh(account)
|
||||
from app.services.scheduler import add_account_job
|
||||
add_account_job(account)
|
||||
return account
|
||||
|
||||
|
||||
@@ -70,6 +74,8 @@ def delete_account(account_id: int, db: Session = Depends(get_db)):
|
||||
account = db.get(Account, account_id)
|
||||
if not account:
|
||||
raise HTTPException(404, "Konto nicht gefunden")
|
||||
from app.services.scheduler import remove_account_job
|
||||
remove_account_job(account_id)
|
||||
db.delete(account)
|
||||
db.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user