[SHOPTIME-3780] [ShopTime 고도화] ShopLC / 상품 재고 수량 체크 기준 변경

This commit is contained in:
hyunwoo93.cha
2025-01-23 15:47:53 +09:00
parent e26c8ab559
commit e8bdaece18
5 changed files with 36 additions and 16 deletions

View File

@@ -482,22 +482,19 @@ export const setGNBMenu = (menu) => ({
payload: menu,
});
export const setErrorMessage = (errorCode, errorMsg) => ({
type: types.SET_ERROR_MESSAGE,
payload: {
errorCode,
errorMsg,
},
});
export const clearErrorMessage = () => ({
type: types.CLEAR_ERROR_MESSAGE,
});
export const showError =
(errorCode, errorMsg, shouldPopPanel = false, retDetailCode = null) =>
(
errorCode,
errorMsg,
shouldPopPanel = false,
retDetailCode = null,
returnBindStrings = null
) =>
(dispatch) => {
dispatch(setErrorMessage(errorCode, errorMsg, retDetailCode));
dispatch(
setShowPopup(Config.ACTIVE_POPUP.errorPopup, {
data: {
@@ -505,6 +502,7 @@ export const showError =
errorMsg,
retDetailCode,
shouldPopPanel,
returnBindStrings,
},
})
);

View File

@@ -528,9 +528,7 @@ export const ERROR_MESSAGES_GROUPS = [
},
{
codes: [1120],
message: $L(
"The selected item is out of stock and cannot be ordered.(ID: Development in progress)"
),
message: $L("The selected item is out of stock and cannot be ordered."),
},
{
codes: [1121],

View File

@@ -542,7 +542,12 @@ export const getTimeDifferenceByMilliseconds = (
return timeDifference > threshold;
};
export const getErrorMessage = (errorCode, retMsg, retDetailCode) => {
export const getErrorMessage = (
errorCode,
retMsg,
retDetailCode,
returnBindStrings
) => {
const group = ERROR_MESSAGES_GROUPS.find((group) =>
group.codes.includes(Number(errorCode))
);
@@ -554,6 +559,16 @@ export const getErrorMessage = (errorCode, retMsg, retDetailCode) => {
: "";
if (group) {
if (
errorCode === 1120 &&
returnBindStrings &&
typeof returnBindStrings === "object"
) {
return `${errorPrefix} ${group.message} (ID: ${returnBindStrings.join(
", "
)})`;
}
return errorPrefix + group.message;
} else if (retMsg) {
return errorPrefix + retMsg;

View File

@@ -408,7 +408,15 @@ export default function SingleOption({
dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup));
dispatch(changeAppStatus({ isLoading: false }));
} else {
dispatch(showError(response.retCode, response.retMsg, false));
dispatch(
showError(
response.retCode,
response.retMsg,
false,
response.retDetailCode,
response.returnBindStrings
)
);
dispatch(changeAppStatus({ isLoading: false }));
return;

View File

@@ -719,7 +719,8 @@ export default function MainView({ className, initService }) {
getErrorMessage(
popupData.errorCode,
popupData.errorMsg,
popupData.retDetailCode
popupData.retDetailCode,
popupData.returnBindStrings
)}
</p>
<TButton className={css.popupBtn} onClick={handleErrorPopupClose}>