Files
Fulfillment-Frontend/src/pages/CardsPage/tabs/ShippingTab/hooks/useUpdateCard.tsx

19 lines
500 B
TypeScript

import { useCardPageContext } from "../../../contexts/CardPageContext.tsx";
import { CardService } from "../../../../../client";
const useUpdateCard = () => {
const { selectedCard, setSelectedCard } = useCardPageContext();
const update = () => {
if (!selectedCard) return;
CardService.getCardById({ cardId: selectedCard.id })
.then(data => {
setSelectedCard(data);
});
};
return { update };
};
export default useUpdateCard;