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 SAVE_PUBLIC_BOARD_HIT_CNT = '/api/v2/ctgy/pboard/hit/';
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 SAVE_BOARD_HIT_CNT = '/api/v1/ctgy/board/hit/';
export const SAVE_BOARD = '/api/v1/ctgy/board';
export const REMOVE_BOARD = '/api/v1/ctgy/board/';
export const SAVE_BOARD_HIT_CNT = '/api/v2/ctgy/board/hit/';
export const SAVE_BOARD = '/api/v2/ctgy/board';
export const REMOVE_BOARD = '/api/v2/ctgy/board/';
// 주정차 의견 진술
export const GET_PARKING_LIST = '/api/v1/ctgy/parking';

@ -62,7 +62,7 @@ export const JWTProvider = ({ children }) => {
// TODO: verifyToken ??
if (accessToken && verifyToken(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);
// TODO : 적용 필요
const { userid, email, name, accesstype } = response.data;

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

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

Loading…
Cancel
Save