Add permission checks and localization improvements
- Add grant check (64, 'X') to QNA register page - Add grant check (45, 'X') to user login auth modification - Replace hardcoded Korean permission messages with i18n key 'common.nopermission' - Add 'nopermission' translation key to both en.json and ko.json - Update .env.development to use development API endpoints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -141,7 +141,7 @@ export const QnaListPage = () => {
|
||||
navigate(PATHS.support.qna.register);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { useQnaSaveMutation } from '@/entities/support/api/use-qna-save-mutation';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
useSetFooterMode,
|
||||
@@ -15,6 +15,7 @@ import { PatternFormat } from 'react-number-format';
|
||||
import { overlay } from 'overlay-kit';
|
||||
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
||||
import { QnaSaveParams, QnaSaveResponse } from '@/entities/support/model/types';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
|
||||
export enum QnaRegisterPropsName {
|
||||
Mid = 'Mid',
|
||||
@@ -142,6 +143,10 @@ export const QnaRegisterPage = () => {
|
||||
};
|
||||
|
||||
const onClickToRegisterQna = () => {
|
||||
if (!checkGrant(64, 'X')) {
|
||||
showAlert(t('common.noPermission'));
|
||||
return;
|
||||
}
|
||||
callRegister();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user