Skip to content

Commit

Permalink
Merge pull request #1407 from andrew-bierman/fix/trips
Browse files Browse the repository at this point in the history
fix trips duplicates
  • Loading branch information
taronaleksanian authored Jan 7, 2025
2 parents ad52dbf + 03bc054 commit 6193888
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/app/hooks/trips/useAddTrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const useAddTrip = () => {
mutation.mutate(newTrip, {
onSuccess: (result) => {
utils.getTrips.invalidate();
utils.getUserTripsFeed.invalidate();
},
});
};
Expand Down
3 changes: 3 additions & 0 deletions packages/app/hooks/trips/useDeleteTrips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import { queryTrpc } from 'app/trpc';

export const useDeleteTrips = (id) => {
const { mutateAsync: deleteTrip } = queryTrpc.deleteTrip.useMutation();
const utils = queryTrpc.useUtils();
const router = useRouter();

const handleDeleteTrip = async () => {
try {
await deleteTrip({ tripId: id });
utils.getTrips.invalidate();
utils.getUserTripsFeed.invalidate();
router.replace('/trips');
} catch {}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/app/screens/trip/TripScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function TripScreen({
flexWrap: 'wrap',
}}
>
<RText style={{ fontWeight: 700, fontSize: 24 }}>
<RText style={{ fontWeight: 700, fontSize: 24, marginTop: 32 }}>
{isViewOnlyMode ? 'Trip Details' : 'Plan Your Trip'}
</RText>
{!isViewOnlyMode && (
Expand Down

0 comments on commit 6193888

Please sign in to comment.