통합피드백 RecentlyViewed 삭제시 show 일경우 추가, 키값 변경
This commit is contained in:
@@ -169,9 +169,23 @@ export default function RecentlyViewed({ title, panelInfo, isOnTop }) {
|
||||
const id = item.prdtId;
|
||||
return selectedItems[id];
|
||||
});
|
||||
const deleteShowInfo = data.productInfos.filter((item) => {
|
||||
const id = item.showId;
|
||||
return selectedItems[id];
|
||||
});
|
||||
|
||||
// 공통 로그 전송 함수
|
||||
const sendDeleteLog = (items, type) => {
|
||||
if (items.length === 0) return;
|
||||
|
||||
const params = {
|
||||
menu: "Recently Viewed",
|
||||
partnerCount: items.length,
|
||||
contextName: LOG_CONTEXT_NAME.MYPAGE,
|
||||
messageId: LOG_MESSAGE_ID.MYPAGE_DELETE,
|
||||
};
|
||||
|
||||
if (deleteProductInfo.length > 0) {
|
||||
const sendDeleteLog = (items) => {
|
||||
if (type === 'product') {
|
||||
const { productId, productTitle, partner } = items.reduce(
|
||||
(result, item) => {
|
||||
result.productId.push(item.prdtId);
|
||||
@@ -181,19 +195,28 @@ export default function RecentlyViewed({ title, panelInfo, isOnTop }) {
|
||||
},
|
||||
{ productId: [], productTitle: [], partner: [] }
|
||||
);
|
||||
const params = {
|
||||
menu: "Recently Viewed",
|
||||
productCount: productId.length,
|
||||
partnerCount: partner.length,
|
||||
contextName: LOG_CONTEXT_NAME.MYPAGE,
|
||||
messageId: LOG_MESSAGE_ID.MYPAGE_DELETE,
|
||||
};
|
||||
params.productCount = productId.length;
|
||||
} else if (type === 'show') {
|
||||
const { showId, showTitle, partner } = items.reduce(
|
||||
(result, item) => {
|
||||
result.showId.push(item.showId);
|
||||
result.showTitle.push(item.showNm);
|
||||
result.partner.push(item.patncNm);
|
||||
return result;
|
||||
},
|
||||
{ showId: [], showTitle: [], partner: [] }
|
||||
);
|
||||
params.showCount = showId.length;
|
||||
}
|
||||
|
||||
dispatch(sendLogTotalRecommend(params));
|
||||
};
|
||||
dispatch(sendLogTotalRecommend(params));
|
||||
};
|
||||
|
||||
sendDeleteLog(deleteProductInfo);
|
||||
}
|
||||
// 제품 정보 로그 전송
|
||||
sendDeleteLog(deleteProductInfo, 'product');
|
||||
|
||||
// 쇼 정보 로그 전송
|
||||
sendDeleteLog(deleteShowInfo, 'show');
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
@@ -195,7 +195,7 @@ export default function Reminders({ title, cbScrollTo }) {
|
||||
|
||||
const params = {
|
||||
menu: "Reminders",
|
||||
contentCount: contentId.length,
|
||||
showCount: contentId.length,
|
||||
partnerCount: partner.length,
|
||||
contextName: Config.LOG_CONTEXT_NAME.MYPAGE,
|
||||
messageId: Config.LOG_MESSAGE_ID.MYPAGE_DELETE,
|
||||
|
||||
Reference in New Issue
Block a user