fix: source fix

main
minuk926 2 years ago
parent 542c2bfed8
commit aec14eaab1

@ -1,5 +1,6 @@
NODE_PATH=src NODE_PATH=src
REACT_APP_MODE=production REACT_APP_MODE=production
REACT_APP_VERSION = v0.0.1 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 REACT_APP_SERVER_TIMEOUT=6000

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

@ -1,9 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
// third party // third party
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux'; 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 { ReactQueryDevtools } from 'react-query/devtools';
import { PersistGate } from 'redux-persist/integration/react'; import { PersistGate } from 'redux-persist/integration/react';
@ -20,6 +21,7 @@ import { ConfigProvider } from 'contexts/ConfigContext';
// style + assets // style + assets
import 'assets/scss/style.scss'; import 'assets/scss/style.scss';
import axios from 'axios';
// ==============================|| REACT DOM RENDER ||============================== // // ==============================|| 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( ReactDOM.render(
// <React.StrictMode>
<Provider store={store}> <Provider store={store}>
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
<PersistGate loading={null} persistor={persister}> <PersistGate loading={null} persistor={persister}>
<ConfigProvider> <ConfigProvider>
<BrowserRouter basename={BASE_PATH}> <BrowserRouter basename={BASE_PATH}>
<AlertProvider template={AlertTemplate} {...options}> <AlertProvider template={AlertTemplate} {...options}>
{/* <React.StrictMode> */}
<App /> <App />
{/* </React.StrictMode> */}
</AlertProvider> </AlertProvider>
</BrowserRouter> </BrowserRouter>
</ConfigProvider> </ConfigProvider>
</PersistGate> </PersistGate>
{/* //TODO : 개발완료시 교체 */}
<ReactQueryDevtools initialIsOpen /> <ReactQueryDevtools initialIsOpen />
{/* <ReactQueryDevtools initialIsOpen={process.env.NODE_ENV !== 'production'} /> */}
</QueryClientProvider> </QueryClientProvider>
</Provider>, </Provider>,
// </React.StrictMode>,
document.getElementById('root') document.getElementById('root')
); );

@ -13,7 +13,9 @@ import logger from 'redux-logger';
const store = configureStore({ const store = configureStore({
reducer: rootReducer, reducer: rootReducer,
middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false, immutableCheck: false }).concat(logger), 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); const persister = persistStore(store);

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

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

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

Loading…
Cancel
Save