feat: mpower 적용

main
minuk926 2 years ago
parent 04ab1dfadf
commit 80bb589553

@ -10,13 +10,13 @@ export const GET_DASHBOARD = '/api/v1/ctgy/dashboard';
export const GET_PUBLIC_BOARD_LIST = '/api/v2/ctgy/pboard'; export const GET_PUBLIC_BOARD_LIST = '/api/v2/ctgy/pboard';
export const SAVE_PUBLIC_BOARD_HIT_CNT = '/api/v2/ctgy/pboard/hit/'; export const SAVE_PUBLIC_BOARD_HIT_CNT = '/api/v2/ctgy/pboard/hit/';
export const SAVE_PUBLIC_BOARD = '/api/v2/ctgy/file/pboard'; export const SAVE_PUBLIC_BOARD = '/api/v2/ctgy/file/pboard';
export const REMOVE_PUBLIC_BOARD = '/api/v1/ctgy/file/pboard/'; export const REMOVE_PUBLIC_BOARD = '/api/v2/ctgy/file/pboard/';
// 게시판 // 게시판
export const GET_BOARD_LIST = '/api/v2/ctgy/board'; export const GET_BOARD_LIST = '/api/v2/ctgy/board';
export const SAVE_BOARD_HIT_CNT = '/api/v1/ctgy/board/hit/'; export const SAVE_BOARD_HIT_CNT = '/api/v2/ctgy/board/hit/';
export const SAVE_BOARD = '/api/v1/ctgy/board'; export const SAVE_BOARD = '/api/v2/ctgy/board';
export const REMOVE_BOARD = '/api/v1/ctgy/board/'; export const REMOVE_BOARD = '/api/v2/ctgy/board/';
// 주정차 의견 진술 // 주정차 의견 진술
export const GET_PARKING_LIST = '/api/v1/ctgy/parking'; export const GET_PARKING_LIST = '/api/v1/ctgy/parking';

@ -62,7 +62,7 @@ export const JWTProvider = ({ children }) => {
// TODO: verifyToken ?? // TODO: verifyToken ??
if (accessToken && verifyToken(accessToken)) { if (accessToken && verifyToken(accessToken)) {
setLocalStorage(ACCESS_TOKEN_NAME, accessToken); setLocalStorage(ACCESS_TOKEN_NAME, accessToken);
const response = await axios.get('/api/v1/ctgy/user/info'); const response = await axios.get('/api/v2/ctgy/user/info');
console.log(response); console.log(response);
// TODO : 적용 필요 // TODO : 적용 필요
const { userid, email, name, accesstype } = response.data; const { userid, email, name, accesstype } = response.data;

@ -20,7 +20,7 @@ const ModifyBoardForm = (props) => {
const quillRef = useRef(); const quillRef = useRef();
const [subject, setSubject] = useState(rowData.ciTitle); const [subject, setSubject] = useState(rowData.ciTitle);
const [contents, setContents] = useState(rowData.ciContents); const [contents, setContents] = useState(rowData.ciContents);
const [pass, setPass] = useState(rowData.ciPass); const [pass, setPass] = useState('');
const onList = () => { const onList = () => {
setOpen(false); setOpen(false);
@ -43,7 +43,7 @@ const ModifyBoardForm = (props) => {
showAlert.show('내용은 필수입니다.'); showAlert.show('내용은 필수입니다.');
return; return;
} }
if (pass === undefined || pass === '') { if (owner && (pass === undefined || pass === '')) {
showAlert.show('비밀번호는 필수입니다.'); showAlert.show('비밀번호는 필수입니다.');
return; return;
} }

@ -1,5 +1,4 @@
import { useState } from 'react'; import { useCallback, useEffect, useState } from 'react';
import { useQuery } from 'react-query';
// material-ui // material-ui
import { Button, Grid, Link } from '@mui/material'; import { Button, Grid, Link } from '@mui/material';
@ -80,24 +79,24 @@ const PublicBoard = () => {
{ headerName: '조회수', headerAlign: 'center', field: 'inHit', align: 'right', width: 80 } { headerName: '조회수', headerAlign: 'center', field: 'inHit', align: 'right', width: 80 }
]; ];
const search = useCallback(() => {
const params = { const params = {
page: rowsState.page, page: rowsState.page,
size: rowsState.pageSize size: rowsState.pageSize
}; };
const search = async () => { findPublicBoards(params).then((response) => {
const res = await findPublicBoards(params); // console.log(response);
if (res && res.data) { if (response && response.data) {
setTotalCount(res.count); setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: res.data })); setRowsState((prevState) => ({ ...prevState, rows: response.data }));
} }
}; });
useQuery(['pboards', params.page, params.size], search); }, [rowsState.page, rowsState.pageSize]);
// const { isLoading, data, isError } = useQuery(['pboards', params.page, params.size], search);
// useEffect(() => { useEffect(() => {
// search(); search();
// }, [search]); // rowsState.page, rowsState.pageSize, rowsState.rows]); }, [search]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
const handleOnCellClick = (e) => { const handleOnCellClick = (e) => {
if (e?.field === 'inTitle') { if (e?.field === 'inTitle') {

Loading…
Cancel
Save