- 링크결제 결제신청확인,완료 페이지 뒤로가기 버튼 삭제
This commit is contained in:
@@ -19,9 +19,19 @@ export const LinkPaymentApplyConfirmPage = () => {
|
|||||||
const { mutateAsync: linkPayRequest } = useExtensionLinkPayRequestMutation();
|
const { mutateAsync: linkPayRequest } = useExtensionLinkPayRequestMutation();
|
||||||
|
|
||||||
useSetHeaderTitle(t('additionalService.linkPayment.messagePreview'));
|
useSetHeaderTitle(t('additionalService.linkPayment.messagePreview'));
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
|
||||||
useSetFooterMode(false);
|
useSetFooterMode(false);
|
||||||
|
|
||||||
|
const getErrorMessage = (errorData: any, validationErrors: any, defaultMessage: string): string => {
|
||||||
|
// validation 에러가 있으면 첫 번째 에러 메시지 반환
|
||||||
|
if (validationErrors && typeof validationErrors === 'object') {
|
||||||
|
const errorValues = Object.values(validationErrors);
|
||||||
|
if (errorValues.length > 0 && errorValues[0]) {
|
||||||
|
return errorValues[0] as string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return errorData?.message || defaultMessage;
|
||||||
|
};
|
||||||
|
|
||||||
const onClickToConfirm = () => {
|
const onClickToConfirm = () => {
|
||||||
if (!formData) {
|
if (!formData) {
|
||||||
console.error('Form data is missing');
|
console.error('Form data is missing');
|
||||||
@@ -50,21 +60,29 @@ export const LinkPaymentApplyConfirmPage = () => {
|
|||||||
language: formData.language,
|
language: formData.language,
|
||||||
linkContentType: formData.linkContentType
|
linkContentType: formData.linkContentType
|
||||||
};
|
};
|
||||||
|
|
||||||
linkPayRequest(requestParams)
|
linkPayRequest(requestParams)
|
||||||
.then((rs: ExtensionLinkPayRequestResponse) => {
|
.then((rs: ExtensionLinkPayRequestResponse) => {
|
||||||
if (rs.status) {
|
if (rs.status) {
|
||||||
navigate(PATHS.additionalService.linkPayment.confirmSuccess);
|
navigate(PATHS.additionalService.linkPayment.confirmSuccess);
|
||||||
} else {
|
} else {
|
||||||
// 일반 에러 메시지
|
const errorMessage = getErrorMessage(
|
||||||
const errorMessage = rs.error?.message || t('additionalService.linkPayment.requestProcessingError');
|
rs.error,
|
||||||
|
rs.error?.details?.validationErrors,
|
||||||
|
t('additionalService.linkPayment.requestProcessingError')
|
||||||
|
);
|
||||||
snackBar(`[${t('common.failed')}] ${errorMessage}`);
|
snackBar(`[${t('common.failed')}] ${errorMessage}`);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
const errorMessage = error?.response?.data?.error?.message ||
|
const errorData = error?.response?.data?.error;
|
||||||
error?.message ||
|
const errorMessage = getErrorMessage(
|
||||||
t('additionalService.linkPayment.requestError');
|
errorData,
|
||||||
if (error.response?.data?.error?.root !== "SystemErrorCode") {
|
errorData?.details?.validationErrors,
|
||||||
|
error?.message || t('additionalService.linkPayment.requestError')
|
||||||
|
);
|
||||||
|
|
||||||
|
if (errorData?.root !== "SystemErrorCode") {
|
||||||
snackBar(`[${t('common.failed')}] ${errorMessage}`);
|
snackBar(`[${t('common.failed')}] ${errorMessage}`);
|
||||||
} else {
|
} else {
|
||||||
showAlert(`[${t('common.failed')}] ${errorMessage}`)
|
showAlert(`[${t('common.failed')}] ${errorMessage}`)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const LinkPaymentApplySuccessPage = () => {
|
|||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
|
||||||
useSetHeaderTitle(t('additionalService.linkPayment.applyTitle'));
|
useSetHeaderTitle(t('additionalService.linkPayment.applyTitle'));
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
//useSetHeaderType(HeaderType.LeftArrow);
|
||||||
useSetFooterMode(false);
|
useSetFooterMode(false);
|
||||||
|
|
||||||
const onClickToHome = () => {
|
const onClickToHome = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user