From 3d28fec8f7a201572f09cc29a56b332671b1a60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Loipf=C3=BChrer?= Date: Sat, 14 Sep 2024 12:10:49 +0200 Subject: [PATCH] fix(core): transaction update and file gallery improvements --- abrechnung/http/routers/transactions.py | 10 +++++----- .../TransactionDetail/FileGallery.tsx | 15 ++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/abrechnung/http/routers/transactions.py b/abrechnung/http/routers/transactions.py index d011090..9baf369 100644 --- a/abrechnung/http/routers/transactions.py +++ b/abrechnung/http/routers/transactions.py @@ -75,7 +75,7 @@ async def create_transaction( transaction=payload, ) - return await transaction_service.get_transaction(user=user, group_id=group_id, transaction_id=transaction_id) + return await transaction_service.get_transaction(user=user, transaction_id=transaction_id) @router.get( @@ -90,7 +90,7 @@ async def get_transaction( user: User = Depends(get_current_user), transaction_service: TransactionService = Depends(get_transaction_service), ): - return await transaction_service.get_transaction(user=user, group_id=group_id, transaction_id=transaction_id) + return await transaction_service.get_transaction(user=user, transaction_id=transaction_id) @router.post( @@ -109,7 +109,7 @@ async def update_transaction( await transaction_service.update_transaction( user=user, transaction_id=transaction_id, transaction=payload, group_id=group_id ) - return await transaction_service.get_transaction(user=user, group_id=group_id, transaction_id=transaction_id) + return await transaction_service.get_transaction(user=user, transaction_id=transaction_id) class UpdatePositionsPayload(BaseModel): @@ -135,7 +135,7 @@ async def update_transaction_positions( transaction_id=transaction_id, positions=payload.positions, ) - return await transaction_service.get_transaction(user=user, group_id=group_id, transaction_id=transaction_id) + return await transaction_service.get_transaction(user=user, transaction_id=transaction_id) @router.delete( @@ -155,7 +155,7 @@ async def delete_transaction( user=user, transaction_id=transaction_id, ) - return await transaction_service.get_transaction(user=user, group_id=group_id, transaction_id=transaction_id) + return await transaction_service.get_transaction(user=user, transaction_id=transaction_id) @router.get( diff --git a/frontend/apps/web/src/pages/transactions/TransactionDetail/FileGallery.tsx b/frontend/apps/web/src/pages/transactions/TransactionDetail/FileGallery.tsx index a302503..f38372e 100644 --- a/frontend/apps/web/src/pages/transactions/TransactionDetail/FileGallery.tsx +++ b/frontend/apps/web/src/pages/transactions/TransactionDetail/FileGallery.tsx @@ -17,6 +17,7 @@ const duration = 200; const defaultStyle = { transition: `opacity ${duration}ms ease-in-out`, + margin: "10px", opacity: 0, }; @@ -45,6 +46,7 @@ const ImageDisplay: React.FC = ({ file, isActive, onShowImage ) : ( = ({ file, isActive, onShowImage {(state) => ( = ({ groupId, transaction } /> )) )} - + {attachments.length > 0 && ( + + )} {active > 0 && (