feat: Implement handleAddEventToProduct function and integrate it into EventProperties and Simulations components
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
interface HandleAddEventToProductParams {
|
||||
selectedAsset: any; // Replace `any` with specific type if you have it
|
||||
addEvent: (productId: string, asset: any) => void;
|
||||
selectedProduct: {
|
||||
productId: string;
|
||||
productName: string;
|
||||
// Add other fields if needed
|
||||
};
|
||||
clearSelectedAsset: () => void;
|
||||
}
|
||||
|
||||
export const handleAddEventToProduct = ({
|
||||
selectedAsset,
|
||||
addEvent,
|
||||
selectedProduct,
|
||||
clearSelectedAsset,
|
||||
}: HandleAddEventToProductParams) => {
|
||||
console.log('selectedProduct: ', selectedProduct);
|
||||
if (selectedAsset) {
|
||||
addEvent(selectedProduct.productId, selectedAsset);
|
||||
// upsertProductOrEventApi({
|
||||
// productName: selectedProduct.productName,
|
||||
// productId: selectedProduct.productId,
|
||||
// eventDatas: selectedAsset
|
||||
// });
|
||||
clearSelectedAsset();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user