fix: source fix

main
minuk926 2 years ago
parent 542c2bfed8
commit aec14eaab1

@ -1,5 +1,6 @@
NODE_PATH=src
REACT_APP_MODE=production
REACT_APP_VERSION = v0.0.1
REACT_APP_API_URL=http://211.119.124.9:8090
#REACT_APP_API_URL=http://211.119.124.9:8090
REACT_APP_API_URL=http://localhost:8090
REACT_APP_SERVER_TIMEOUT=6000

@ -94,7 +94,8 @@
"build": "env-cmd -f .env.production react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"format": "prettier --write ."
"format": "prettier --write .",
"serve" : "serve -s build"
},
"eslintConfig": {
"extends": [

@ -1,9 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom';
// third party
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { QueryClient, QueryClientProvider } from 'react-query';
import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from 'react-query';
import { ReactQueryDevtools } from 'react-query/devtools';
import { PersistGate } from 'redux-persist/integration/react';
@ -20,6 +21,7 @@ import { ConfigProvider } from 'contexts/ConfigContext';
// style + assets
import 'assets/scss/style.scss';
import axios from 'axios';
// ==============================|| REACT DOM RENDER ||============================== //
@ -35,23 +37,50 @@ const options = {
}
};
const queryClient = new QueryClient();
const queryClient = new QueryClient({
mutationCache: new MutationCache({
onError: (error) => {
if (axios.isAxiosError(error)) {
const errorCode = error.response?.data.code;
console.log(`###################@@@@@@@@@@@@@@${errorCode}`); // 에러 팝업 띄우기
} else {
throw error; // error boundary로 전달
}
}
}),
queryCache: new QueryCache({
onError: (error) => {
if (axios.isAxiosError(error)) {
const errorCode = error.response?.data.code;
console.log(`###################@@@@@@@@@@@@@@${errorCode}`); // 에러 팝업 띄우기
} else {
throw error; // error boundary로 전달
}
}
})
});
ReactDOM.render(
// <React.StrictMode>
<Provider store={store}>
<QueryClientProvider client={queryClient}>
<PersistGate loading={null} persistor={persister}>
<ConfigProvider>
<BrowserRouter basename={BASE_PATH}>
<AlertProvider template={AlertTemplate} {...options}>
{/* <React.StrictMode> */}
<App />
{/* </React.StrictMode> */}
</AlertProvider>
</BrowserRouter>
</ConfigProvider>
</PersistGate>
{/* //TODO : 개발완료시 교체 */}
<ReactQueryDevtools initialIsOpen />
{/* <ReactQueryDevtools initialIsOpen={process.env.NODE_ENV !== 'production'} /> */}
</QueryClientProvider>
</Provider>,
// </React.StrictMode>,
document.getElementById('root')
);

@ -13,7 +13,9 @@ import logger from 'redux-logger';
const store = configureStore({
reducer: rootReducer,
middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false, immutableCheck: false }).concat(logger),
devTools: process.env.NODE_ENV !== 'production'
// TODO :: 개발 완료시 교체
devTools: true
// devTools: process.env.NODE_ENV !== 'production'
});
const persister = persistStore(store);

@ -9,16 +9,6 @@ import { dispatch } from '../index';
const initialState = {
error: null
// usersS1: [],
// usersS2: [],
// followers: [],
// friendRequests: [],
// friends: [],
// gallery: [],
// posts: [],
// detailCards: [],
// simpleCards: [],
// profileCards: []
};
const slice = createSlice({

@ -16,6 +16,7 @@ import JudgeDataDetailForm from './JudgeDataDetailForm';
import { useAlert } from 'react-alert';
import { getComboCodeList } from 'apis/common';
import JudgeDataModifyForm from './JudgeDataModifyForm';
import { useQuery } from 'react-query';
const JudgeDataReview = ({ scDatagb, menuName }) => {
const showAlert = useAlert();
@ -74,13 +75,13 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
{ headerName: '자료상태', headerAlign: 'center', field: 'scStateNm', align: 'center' }
];
const search = useCallback(() => {
const params = {
scDatagb, //
page: rowsState.page,
size: rowsState.pageSize
};
const params = {
scDatagb, //
page: rowsState.page,
size: rowsState.pageSize
};
const search = useCallback(() => {
findJudgeDatas(params).then((response) => {
if (response && response.data) {
setTotalCount(response.count);

@ -99,12 +99,6 @@ const PublicBoard = () => {
setTitle('공지사항 상세');
setSelectedRow(e?.row);
setOwner(user.name === e?.row.inName);
// eslint-disable-next-line react-hooks/rules-of-hooks
// useMutation(modifyPublicBoardHitCount(e?.row?.inCode), {
// onSuccess: () => {
// queryClient.invalidateQueries('pboards');
// }
// });
modifyPublicBoardHitCount(e?.row?.inCode);
setOpen(true);
}
@ -115,17 +109,27 @@ const PublicBoard = () => {
case 'SAVE':
setOpen(false);
saveAlert(() =>
// eslint-disable-next-line react-hooks/rules-of-hooks
useMutation(savePublicBoard(payload))
);
saveAlert(() => {
savePublicBoard(payload).then((res) => {
if (res?.success) {
search();
} else {
alert.show(`${res?.data.message}`);
}
});
});
break;
case 'DELETE':
setOpen(false);
removeAlert(
// eslint-disable-next-line react-hooks/rules-of-hooks
() => useMutation(removePublicBoard(payload))
removePublicBoard(payload).then((res) => {
if (res?.success) {
search();
} else {
alert.show(`${res?.data.message}`);
}
})
);
break;
default:

Loading…
Cancel
Save