Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): transaction update and file gallery improvements #238

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading