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