Add permission checks to SMS payment pages

- Add grant check (57, 'D') to SMS payment download button
- Add grant check (57, 'X') to SMS resend button
- Refactor onClick handlers for better code organization

Changes:
- sms-payment-page: Add permission check for download, move onClick to button
- sms-payment-detail-resend: Add imports for permission check functions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jay Sheen
2025-11-05 19:04:49 +09:00
parent 47555e6e42
commit e4871b6492
2 changed files with 13 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ import { SmsPaymentDetailResendProps } from '../../../additional-service/model/s
import { useExtensionSmsResendMutation } from '../../api/sms-payment/use-extension-sms-resend-mutation';
import appBridge from '@/shared/lib/appBridge';
import { snackBar } from '@/shared/lib';
import { checkGrant } from '@/shared/lib/check-grant';
import { showAlert } from '@/widgets/show-alert';
export const SmsPaymentDetailResend = ({
bottomSmsPaymentDetailResendOn,
@@ -22,6 +24,10 @@ export const SmsPaymentDetailResend = ({
const {mutateAsync : resendMessage } = useExtensionSmsResendMutation();
const onClickResend = () => {
if (!checkGrant(57, 'X')) {
showAlert(t('common.nopermission'));
return;
}
// sendMessage가 없으면 재발송 불가
if (!smsDetailData?.sendMessage) {
return;