Skip to content

Commit e9aff15

Browse files
committed
Feat: 베타용 최종
1 parent 25afc91 commit e9aff15

File tree

33 files changed

+625
-147
lines changed

33 files changed

+625
-147
lines changed

package-lock.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"antd": "^5.21.2",
2323
"axios": "^1.7.7",
2424
"bootstrap": "^5.3.3",
25+
"chart.js": "^4.4.6",
2526
"date-fns": "^4.1.0",
2627
"fs": "^0.0.1-security",
2728
"install": "^0.13.0",
@@ -31,6 +32,7 @@
3132
"react": "^18.3.1",
3233
"react-beautiful-dnd": "^13.1.1",
3334
"react-bootstrap": "^2.10.5",
35+
"react-chartjs-2": "^5.2.0",
3436
"react-datepicker": "^7.4.0",
3537
"react-dom": "^18.3.1",
3638
"react-geocode": "^1.0.0-alpha.1",

src/App.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import QnaDetail from './pages/Qna/QnaDetail';
99
import RegistProject from './pages/Request/RegistProject';
1010
import RequestHome from './pages/Request/RequestHome';
1111
import RequestDetail from './pages/Request/RequestDetail';
12+
// import ProjectSupport
1213
import Callback from './auth/Callback';
13-
import useStore from './zustand/Store';
14+
import { useStore } from './zustand/Store';
1415

1516
function App() {
1617
return (
@@ -28,6 +29,7 @@ function App() {
2829
<Route path="project" element={<RequestHome />} />
2930
<Route path="project/:requestId" element={<RequestDetail />} />
3031
<Route path="project/regist" element={<RegistProject />} />
32+
{/* <Route path="project/support" element={<ProjectSupport />} /> */}
3133
</Route>
3234
{/* User Regist */}
3335
<Route path="/regist" element={<Regist />} />

src/api/oauth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from 'axios';
22
import { GetAxiosInstance, PostAxiosInstance } from '../axios/AxiosMethod';
33
import { uploadFiles } from './file';
4-
import useStore from '../zustand/Store';
4+
import { useStore } from '../zustand/Store';
55

66
const baseURL = import.meta.env.VITE_BASE_URL;
77
const url = `${import.meta.env.VITE_LOGIN_URL}${import.meta.env.VITE_CLIENT_ID}&redirect_uri=${import.meta.env.VITE_REDIRECT_URL}&response_type=code&scope=basic_profile&scope=friends_list&scope=presence`;

src/api/request.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import axios from 'axios';
22
import { GetAxiosInstance, PostAxiosInstance } from '../axios/AxiosMethod';
33

4+
const baseURL = import.meta.env.VITE_BASE_URL;
5+
46
export const registRequestInfo = async (projectInfo) => {
57
try {
68
const res = await PostAxiosInstance('/api/project', projectInfo);
@@ -12,7 +14,7 @@ export const registRequestInfo = async (projectInfo) => {
1214

1315
export const getRequestDetail = async (projectId) => {
1416
try {
15-
const res = await GetAxiosInstance(`/api/project/${projectId}`);
17+
const res = await GetAxiosInstance(`/api/project/detail/${projectId}`);
1618
return res;
1719
} catch (e) {
1820
console.error(e);
@@ -21,9 +23,7 @@ export const getRequestDetail = async (projectId) => {
2123

2224
export const getAllRequests = async (page) => {
2325
try {
24-
const res = await GetAxiosInstance(
25-
`/api/project/summary/pagination?page=${page}`,
26-
);
26+
const res = await axios.get(`${baseURL}/api/project/summary/${page}`);
2727
return res;
2828
} catch (e) {
2929
console.error(e);
@@ -32,8 +32,26 @@ export const getAllRequests = async (page) => {
3232

3333
export const getHomeRequests = async () => {
3434
try {
35-
const res = await axios.get(
36-
`${import.meta.env.VITE_BASE_URL}/api/project/summary/home`,
35+
const res = await axios.get(`${baseURL}/api/project/summary/home`);
36+
return res;
37+
} catch (e) {
38+
console.error(e);
39+
}
40+
};
41+
42+
export const getTeamData = async (projectId) => {
43+
try {
44+
const res = await GetAxiosInstance(`/api/team/${projectId}/support/list`);
45+
return res;
46+
} catch (e) {
47+
console.error(e);
48+
}
49+
};
50+
51+
export const acceptTeam = async (projectId, teamId) => {
52+
try {
53+
const res = await PostAxiosInstance(
54+
`/api/project/accept/epic/${projectId}/${teamId}`,
3755
);
3856
return res;
3957
} catch (e) {

src/auth/Callback.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useEffect } from 'react';
22
import { checkIsRegisted, getToken } from '../api/oauth';
33
import { useNavigate } from 'react-router-dom';
4-
import useStore from '../zustand/Store';
4+
import { useStore, usePersistentStore } from '../zustand/Store';
55
const Callback = () => {
66
const navigate = useNavigate();
7-
const { setIsLogin } = useStore();
7+
const { setIsLogin } = usePersistentStore();
88
useEffect(() => {
99
const getAccessToken = async () => {
1010
await getToken();

src/axios/AxiosInstance.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,26 @@ const axiosInstance = axios.create({ baseURL: import.meta.env.VITE_BASE_URL });
66
axiosInstance.interceptors.request.use(
77
async (config) => {
88
const accessToken = localStorage.getItem('accessToken');
9-
109
if (!accessToken) {
1110
localStorage.clear();
1211
alert('로그인 해주세요');
1312
window.location.href = '/home';
1413
throw new Error('토큰 없음');
1514
}
16-
1715
config.headers['Authorization'] = `Bearer ${accessToken}`;
18-
1916
return config;
2017
},
2118
(error) => {
2219
return Promise.reject(error);
2320
},
2421
);
2522

26-
// 토큰 관련 에러 처리
2723
axiosInstance.interceptors.response.use(
2824
async (response) => {
2925
return response;
3026
},
3127

3228
async (error) => {
33-
// 토큰 만료나 잘못된 토큰일 때 로그아웃 처리
3429
if (error.response?.data?.status === '449') {
3530
console.log('잘못된 토큰');
3631
const originalConfig = error.config;
@@ -46,7 +41,6 @@ axiosInstance.interceptors.response.use(
4641
alert('토큰이 만료되었습니다. 다시 로그인 해주세요.');
4742
}
4843
}
49-
5044
return Promise.reject(error);
5145
},
5246
);

src/components/common/Filter/Buttons/FilterButtons.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from 'react';
2-
import useStore from '../../../../zustand/Store';
2+
import { useStore } from '../../../../zustand/Store';
33
import {
44
Container,
55
SortButtonContainer,

src/components/common/InputText/InputText.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { InputContainer, TextArea } from './style';
3-
import useStore from '../../../zustand/Store';
3+
import { useStore } from '../../../zustand/Store';
44

55
const InputText = (props) => {
66
const { projectInfo, setProjectInfo } = useStore();

src/components/common/PageNation/NextPrevButton/NextPrevButton.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Button } from './style';
3-
import useStore from '../../../../zustand/Store';
3+
import { useStore } from '../../../../zustand/Store';
44
const NextPrevButton = ({ isNext }) => {
55
const { setDetailPage } = useStore();
66
const handleNextButtonClick = () => {

0 commit comments

Comments
 (0)