feat: processing of modules in card, renaming
This commit is contained in:
@@ -30,7 +30,7 @@ const ProductAndServiceTab: FC = () => {
|
||||
useCardProductAndServiceTabState();
|
||||
const isLocked = Boolean(cardState.card?.billRequest || cardState.card?.group?.billRequest);
|
||||
const onAddProductClick = () => {
|
||||
if (!cardProductsState.onCreate || !cardState.card) return;
|
||||
if (!cardProductsState.onCreate || !cardState.card || !cardState.card.clientId) return;
|
||||
const productIds = cardState.card.products.map(
|
||||
product => product.product.id
|
||||
);
|
||||
@@ -108,7 +108,7 @@ const ProductAndServiceTab: FC = () => {
|
||||
await cardState.refetch();
|
||||
});
|
||||
};
|
||||
const onDealKitAdd = (kit: GetServiceKitSchema) => {
|
||||
const onCardKitAdd = (kit: GetServiceKitSchema) => {
|
||||
if (!cardState.card) return;
|
||||
CardService.addKitToCard({
|
||||
requestBody: {
|
||||
@@ -130,7 +130,7 @@ const ProductAndServiceTab: FC = () => {
|
||||
});
|
||||
};
|
||||
const onCreateProductClick = () => {
|
||||
if (!cardState.card) return;
|
||||
if (!cardState.card || !cardState.card.clientId) return;
|
||||
modals.openContextModal({
|
||||
modal: "createProduct",
|
||||
title: "Создание товара",
|
||||
@@ -240,7 +240,7 @@ const ProductAndServiceTab: FC = () => {
|
||||
direction={"column"}
|
||||
className={styles["deal-container-wrapper"]}>
|
||||
<CardServicesTable
|
||||
onKitAdd={onDealKitAdd}
|
||||
onKitAdd={onCardKitAdd}
|
||||
{...cardServicesState}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user