feat: cards, attributes and modules
This commit is contained in:
18
src/pages/CardsPage/tabs/ShippingTab/hooks/useUpdateCard.tsx
Normal file
18
src/pages/CardsPage/tabs/ShippingTab/hooks/useUpdateCard.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user