diff --git a/src/entities/transaction/ui/detail/escrow-detail.tsx b/src/entities/transaction/ui/detail/escrow-detail.tsx index d55aec2..34202c9 100644 --- a/src/entities/transaction/ui/detail/escrow-detail.tsx +++ b/src/entities/transaction/ui/detail/escrow-detail.tsx @@ -104,7 +104,7 @@ export const EscrowDetail = ({ const onClickToShowMailResend = () => { - if(checkGrant(menuId, 'X')){ + if(checkGrant(menuId, ' W')){ setDownloadBottomSheetOn(true); } else{ diff --git a/src/entities/vat-return/ui/list-wrap.tsx b/src/entities/vat-return/ui/list-wrap.tsx index 6b8ab5b..4d5ade2 100644 --- a/src/entities/vat-return/ui/list-wrap.tsx +++ b/src/entities/vat-return/ui/list-wrap.tsx @@ -130,7 +130,7 @@ export const ListWrap = () => { setSortType(sort); }; const onClickToOpenDownloadBottomSheet = () => { - if (!checkGrant(menuId, 'X')) { + if (!checkGrant(menuId, 'D')) { showAlert(t('common.nopermission')); return; } diff --git a/src/entities/vat-return/ui/reference-wrap.tsx b/src/entities/vat-return/ui/reference-wrap.tsx index 149e5c0..d65722c 100644 --- a/src/entities/vat-return/ui/reference-wrap.tsx +++ b/src/entities/vat-return/ui/reference-wrap.tsx @@ -35,7 +35,7 @@ export const ReferenceWrap = () => { const { mutateAsync: vatReturnReferenceRequest } = useVatReturnReferenceRequestMutation(); const onClickToResquest = () => { - if(checkGrant(menuId, 'R')){ + if(checkGrant(menuId, 'W')){ let params: VatReturnReferenceRequestParams = { mid: mid, startDate: startDate, diff --git a/src/pages/support/qna/register-page.tsx b/src/pages/support/qna/register-page.tsx index 99cb70f..b1223f2 100644 --- a/src/pages/support/qna/register-page.tsx +++ b/src/pages/support/qna/register-page.tsx @@ -29,7 +29,7 @@ export enum QnaRegisterPropsName { Title = 'Title', Contents = 'Contents', }; - +const menuId = 64; export const QnaRegisterPage = () => { const { navigate } = useNavigate(); const { t } = useTranslation(); @@ -136,7 +136,7 @@ export const QnaRegisterPage = () => { }; const onClickToRegisterQna = () => { - if (!checkGrant(64, 'W')) { + if (!checkGrant(menuId, 'W')) { showAlert(t('common.nopermission')); return; } diff --git a/src/pages/transaction/billing/charge-page.tsx b/src/pages/transaction/billing/charge-page.tsx index 42bfa7b..c2f0471 100644 --- a/src/pages/transaction/billing/charge-page.tsx +++ b/src/pages/transaction/billing/charge-page.tsx @@ -18,7 +18,9 @@ import NiceCalendar from '@/shared/ui/calendar/nice-calendar'; import { notiBar, snackBar } from '@/shared/lib'; import { BillingChargeParams, BillingChargeResponse } from '@/entities/transaction/model/types'; import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware'; +import { checkGrant } from '@/shared/lib/check-grant'; +const menuId = 34; export const BillingChargePage = () => { const { navigate } = useNavigate(); const { t } = useTranslation(); @@ -52,46 +54,52 @@ export const BillingChargePage = () => { }; const onClickToBillingCharge = () => { - if (!billKey) { - showAlert('빌키는 필수 입력 항목입니다.'); - return; - } - else if (!productName) { - showAlert('상품명은 필수 입력 항목입니다.'); - } - else if (!productAmount) { - showAlert('상품금액은 필수 입력 항목입니다.'); - } - else if (productAmount <= 0) { - showAlert('상품금액은 0보다 커야 합니다.'); - } - else if (!orderNumber) { - showAlert('주문번호는 필수 입력 항목입니다.'); - } - else if (!buyerName) { - showAlert('구매자명은 필수 입력 항목입니다.'); - } - - let params: BillingChargeParams = { - billKey: billKey, - productName: productName, - productAmount: productAmount, - orderNumber: orderNumber, - buyerName: buyerName, - paymentRequestDate: moment(paymentRequestDate).format('YYYYMMDD'), - installmentMonth: installmentMonth - }; - billingCharge(params).then((rs: BillingChargeResponse) => { - snackBar('결제 신청을 성공하였습니다.', function () { - navigate(PATHS.transaction.billing.list); - }, 3000); - - }).catch((e: any) => { - if (e.response?.data?.error?.message) { - snackBar(e.response?.data?.error?.message); + if(checkGrant(menuId, 'W')){ + if (!billKey) { + showAlert('빌키는 필수 입력 항목입니다.'); return; } - }); + else if (!productName) { + showAlert('상품명은 필수 입력 항목입니다.'); + } + else if (!productAmount) { + showAlert('상품금액은 필수 입력 항목입니다.'); + } + else if (productAmount <= 0) { + showAlert('상품금액은 0보다 커야 합니다.'); + } + else if (!orderNumber) { + showAlert('주문번호는 필수 입력 항목입니다.'); + } + else if (!buyerName) { + showAlert('구매자명은 필수 입력 항목입니다.'); + } + + let params: BillingChargeParams = { + billKey: billKey, + productName: productName, + productAmount: productAmount, + orderNumber: orderNumber, + buyerName: buyerName, + paymentRequestDate: moment(paymentRequestDate).format('YYYYMMDD'), + installmentMonth: installmentMonth + }; + billingCharge(params).then((rs: BillingChargeResponse) => { + snackBar('결제 신청을 성공하였습니다.', function () { + navigate(PATHS.transaction.billing.list); + }, 3000); + + }).catch((e: any) => { + if (e.response?.data?.error?.message) { + snackBar(e.response?.data?.error?.message); + return; + } + }); + } + else{ + showAlert(t('common.nopermission')); + } + }; const onChangeBillKey = (value: string) => {