Initial commit
This commit is contained in:
17
backend/app/routers/transactions.py
Normal file
17
backend/app/routers/transactions.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from fastapi import APIRouter
|
||||
from ..clients.firefly_client import firefly_client
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("")
|
||||
async def list_transactions():
|
||||
transactions = await firefly_client.get_transactions()
|
||||
return {"data": transactions}
|
||||
|
||||
|
||||
@router.get("/sample")
|
||||
async def transaction_sample():
|
||||
transactions = await firefly_client.get_transactions()
|
||||
if transactions:
|
||||
return {"sample": transactions[0]}
|
||||
return {"sample": None}
|
||||
Reference in New Issue
Block a user