부가서비스
- SMS결제통보_재발송 API 추가
This commit is contained in:
@@ -1,17 +1,47 @@
|
||||
import { motion } from 'framer-motion';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { SmsPaymentDetailResendProps } from '../../../additional-service/model/sms-payment/types';
|
||||
import { useExtensionSmsResendMutation } from '../../api/sms-payment/use-extension-sms-resend-mutation';
|
||||
import appBridge from '@/shared/lib/appBridge';
|
||||
|
||||
export const SmsPaymentDetailResend = ({
|
||||
bottomSmsPaymentDetailResendOn,
|
||||
setBottomSmsPaymentDetailResendOn,
|
||||
smsDetailData
|
||||
smsDetailData,
|
||||
mid,
|
||||
tid
|
||||
}: SmsPaymentDetailResendProps) => {
|
||||
|
||||
const variants = {
|
||||
hidden: { y: '100%' },
|
||||
visible: { y: '0%' },
|
||||
};
|
||||
|
||||
const {mutateAsync : resendMessage } = useExtensionSmsResendMutation();
|
||||
|
||||
const onClickResend = () => {
|
||||
// sendMessage가 없으면 재발송 불가
|
||||
if (!smsDetailData?.sendMessage) {
|
||||
return;
|
||||
}
|
||||
|
||||
resendMessage({
|
||||
mid: mid,
|
||||
tid: tid
|
||||
}).then((rs) => {
|
||||
console.log("Resend 성공: ", rs);
|
||||
appBridge.showToast("SMS 발송을 성공하였습니다.");
|
||||
setBottomSmsPaymentDetailResendOn(false);
|
||||
}).catch((error) => {
|
||||
console.error("Resend 실패: ", error);
|
||||
|
||||
// 실패 토스트 메시지 표시
|
||||
const errorMessage = error?.message || "알 수 없는 오류";
|
||||
const failMessage = `[실패] ${errorMessage}`;
|
||||
appBridge.showToast(failMessage);
|
||||
});
|
||||
}
|
||||
|
||||
const onClickToClose = () => {
|
||||
// close
|
||||
setBottomSmsPaymentDetailResendOn(false);
|
||||
@@ -52,7 +82,14 @@ export const SmsPaymentDetailResend = ({
|
||||
<p className="resend-text">{smsDetailData?.sendMessage || '-'}</p>
|
||||
</div>
|
||||
<div className="bottomsheet-footer">
|
||||
<button className="btn-50 btn-blue flex-1" type="button">신청</button>
|
||||
<button
|
||||
className={`btn-50 flex-1 ${smsDetailData?.sendMessage ? 'btn-blue' : 'btn-gray'}`}
|
||||
type="button"
|
||||
onClick={onClickResend}
|
||||
disabled={!smsDetailData?.sendMessage}
|
||||
>
|
||||
신청
|
||||
</button>
|
||||
</div>
|
||||
</motion.div>
|
||||
</>
|
||||
|
||||
@@ -59,8 +59,8 @@ export const SmsPaymentFilter = ({
|
||||
|
||||
let smsTypeOption = [
|
||||
{ name: '전체', value: SmsType.ALL },
|
||||
{ name: '가상계좌요청', value: SmsType.VACCOUNT_REQ },
|
||||
{ name: '가상계좌 요청+입금', value: SmsType.VACCOUNT_REQ_DEPOSIT },
|
||||
{ name: '가상계좌\n요청', value: SmsType.VACCOUNT_REQ },
|
||||
{ name: '가상계좌\n요청+입금', value: SmsType.VACCOUNT_REQ_DEPOSIT },
|
||||
]
|
||||
|
||||
const onClickToClose = () => {
|
||||
|
||||
Reference in New Issue
Block a user