Skip to content

Commit

Permalink
Merge pull request #238 from SFTtech/milo/fix-transaction-update
Browse files Browse the repository at this point in the history
fix(core): transaction update and file gallery improvements
  • Loading branch information
mikonse authored Sep 14, 2024
2 parents 00f8df5 + 3d28fec commit 9dc5c75
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
10 changes: 5 additions & 5 deletions abrechnung/http/routers/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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):
Expand All @@ -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(
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const duration = 200;

const defaultStyle = {
transition: `opacity ${duration}ms ease-in-out`,
margin: "10px",
opacity: 0,
};

Expand Down Expand Up @@ -45,6 +46,7 @@ const ImageDisplay: React.FC<ImageDisplayProps> = ({ file, isActive, onShowImage
) : (
<img
height="100%"
width="100%"
style={{
...defaultStyle,
...transitionStyles[state],
Expand All @@ -66,6 +68,7 @@ const ImageDisplay: React.FC<ImageDisplayProps> = ({ file, isActive, onShowImage
{(state) => (
<img
height="100%"
width="100%"
style={{
...defaultStyle,
...transitionStyles[state],
Expand Down Expand Up @@ -181,11 +184,13 @@ export const FileGallery: React.FC<FileGalleryProps> = ({ groupId, transaction }
/>
))
)}
<Chip
sx={{ position: "absolute", top: "5px", right: "10px" }}
size="small"
label={`${active + 1} / ${attachments.length}`}
/>
{attachments.length > 0 && (
<Chip
sx={{ position: "absolute", top: "5px", right: "10px" }}
size="small"
label={`${active + 1} / ${attachments.length}`}
/>
)}
{active > 0 && (
<IconButton onClick={toPrevImage} sx={{ position: "absolute", top: "40%", left: "10px" }}>
<ChevronLeft />
Expand Down

0 comments on commit 9dc5c75

Please sign in to comment.