Skip to content

Commit

Permalink
Merge pull request #227 from TUK-DP/refactor/218
Browse files Browse the repository at this point in the history
Refactor/218 마이페이지 수정
  • Loading branch information
heedong12 authored Jun 19, 2024
2 parents 58df55b + 01f1db2 commit f9f5943
Show file tree
Hide file tree
Showing 33 changed files with 1,088 additions and 1,084 deletions.
72 changes: 47 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"html2canvas": "^1.4.1",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"query-string": "^9.0.0",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
Expand All @@ -24,7 +25,6 @@
"react-scripts": "5.0.1",
"react-simple-image-slider": "^2.4.1",
"reacticons": "^0.0.1",
"recoil": "^0.7.7",
"redux": "^5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down Expand Up @@ -54,6 +54,5 @@
},
"devDependencies": {
"tailwindcss": "^3.4.1"
},
"proxy": "https://tukorea-dp.s3.amazonaws.com"
}
}
23 changes: 5 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Surveyresult from "./pages/Survey/SurveyResult.js";
import BeforeGame from "./pages/gamePages/BeforeGame";
import Gymnastics from "./pages/Gym/Gymnastics";
import GymnasticsVideo from "./pages/Gym/GymnasticsVideo";
import MyPage from "./pages/MyPages/MyPage";
import MyPage from "./pages/MyPage";
import CenterMap from "./pages/CenterPages/CenterMap";
import PrevSurveyResult from "./pages/Survey/PrevSurveyResult";
import SurveyError from "./pages/Survey/SurveyError";
Expand All @@ -34,19 +34,11 @@ import Login from "./pages/Login";
import Signup from "./pages/Signup";
import useAutoLogin from "./hooks/useAutoLogin";
import Explain from "./pages/Keyword/Explain.js";
import UserUpdate, {
USER_UPDATE_PAGE_PATH,
} from "./pages/MyPages/UserUpdate.js";
import DiaryManagement, {
DIARY_MANAGEMENT_PAGE_PATH,
} from "./pages/MyPages/DiaryManagement.js";
import UserUpdate from "./pages/UserUpdate.js";
import DiaryManagement from "./pages/DiaryManagement.js";
import HelpForAi from "./pages/ImageDiary/HelpForAi.js";
import ShowAiResult from "./pages/ImageDiary/ShowAiResult.js";
import Keyword from "./pages/Keyword/Keyword.js";
import {
API_KEY_INPUT_PAGE_PATH,
APIKeyInput,
} from "./pages/MyPages/APIKeyInput";

function App() {
let { loading } = useAutoLogin();
Expand Down Expand Up @@ -91,17 +83,12 @@ function App() {
<Route exact path={"/centermap"} element={<CenterMap />} />
<Route exact path={"/explain"} element={<Explain />} />
<Route exact path={"/keyword"} element={<Keyword />} />
<Route exact path={USER_UPDATE_PAGE_PATH} element={<UserUpdate />} />
<Route exact path={"/userupdate"} element={<UserUpdate />} />
<Route
exact
path={DIARY_MANAGEMENT_PAGE_PATH}
path={"/diarymanagement"}
element={<DiaryManagement />}
/>
<Route
exact
path={API_KEY_INPUT_PAGE_PATH}
element={<APIKeyInput />}
/>
<Route
exact
path={"/prevsurveyresult"}
Expand Down
6 changes: 0 additions & 6 deletions src/api/diary.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,5 @@ class DiaryController extends Api {
`/diary/list?userId=${userId}&startDate=${startDate}&finishDate=${finishDate}&sortBy=${sortBy}`
);
};
//기간별 일기 유무 리스트 가져오기
checkDiaryList = async ({ userId, year, month }) => {
return await this.get(
`/diary/check?userId=${userId}&year=${year}&month=${month}`
);
};
}
export default new DiaryController();
29 changes: 20 additions & 9 deletions src/api/users.controller.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
import { Api } from "./common.controller";
import axios from "axios";

const axiosInstance = axios.create({
baseURL: process.env.REACT_APP_SERVER_URL,
});

// 회원 정보 수정 메서드
const updateUser = async ({ userData, accessToken }) => {
return await axiosInstance.put("/users", userData, {
headers: {
AccessToken: `${accessToken}`,
},
});
};

class UserController extends Api {
// 회원가입
signUp = async (userData) => {
return await this.post("/users/signup", { data: userData });
};

// 로그인
signIn = async (loginData) => {
return await this.post("/users/login", { data: loginData });
};
//닉네임 중복확인

// 닉네임 중복확인
checkNickname = async (nickname) => {
return await this.post("/users/checknickname", { data: nickname });
};

// 자동 로그인
autoLogin = async ({ userId, AccessToken, RefreshToken }) => {
return await this.get(`/users/${userId}/auto/login`, {
Expand All @@ -25,15 +42,9 @@ class UserController extends Api {
},
});
};

// 회원 정보 수정
updateUser = async ({ userData, accessToken }) => {
return await this.put("/users", userData, {
headers: {
AccessToken: `${accessToken}`,
"Content-Type": "application/json",
},
});
};
updateUser = updateUser;

// 회원탈퇴
}
Expand Down
3 changes: 2 additions & 1 deletion src/component/ImageDiary/AIModal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import BackGroundSkyButton from "../BackGroundSkyButton";
import { IoClose } from "react-icons/io5";
import { useNavigate } from "react-router-dom";

const AIModal = ({ onClose, content, keyword }) => {
Expand All @@ -10,7 +11,7 @@ const AIModal = ({ onClose, content, keyword }) => {
return (
<div
className={
"w-full h-full fixed top-0 left-0 flex justify-center items-center bg-opacity-30 bg-black z-10"
"w-full h-full fixed top-0 left-0 flex justify-center items-center bg-opacity-30 bg-black"
}
>
<div className={"absolute bg-white w-4/5 h-fit py-7 px-3 rounded-2xl"}>
Expand Down
Loading

0 comments on commit f9f5943

Please sign in to comment.