Skip to content

Commit

Permalink
chore : code cleaning_2
Browse files Browse the repository at this point in the history
  • Loading branch information
raylee0519 committed Aug 4, 2022
1 parent 3527ebf commit 86bba2b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
8 changes: 2 additions & 6 deletions frontend/src/components/Mypage/Change_nickname.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import * as React from "react";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import axios from "axios";
import { API_BASE_URL } from "src/utils/constants";
import { getAccess } from "../../Auth/tokenManager";
import { setAccessToken, setRefreshToken } from "src/Auth/tokenManager";
import { useState } from "react";
Expand Down Expand Up @@ -77,10 +75,8 @@ function ChangeNickName() {

if (stringAccess !== null) {

await axios
.patch(
`${API_BASE_URL}/users/`,
{ value: { alias: changeAlias } },
await Api
.patch(`/users/`, { value: { alias: changeAlias } },
{
//patch : 바디 -> 변경할 alias & 헤더 -> 확인해야되는 토큰
headers: {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/Mypage/Change_password.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from "react";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import axios from "axios";
import { API_BASE_URL } from "src/utils/constants";
import { getAccess } from "../../Auth/tokenManager";
import { setAccessToken, setRefreshToken } from "src/Auth/tokenManager";
import { useState } from "react";
import Api from "../../utils/customApi";

import {
FormHelperText,
Expand Down Expand Up @@ -58,10 +58,10 @@ function ChangePassWord() {
const aliasChange = async (changePassword: string) => {
const stringAccess: any = getAccess();

if (stringAccess !== null) {
if (stringAccess !== null) {

await axios
.patch(`${API_BASE_URL}/users/`, { "value": { password: changePassword } }, { //patch : 바디 -> 변경할 alias & 헤더 -> 확인해야되는 토큰
await Api
.patch(`/users/`, { "value": { password: changePassword } }, { //patch : 바디 -> 변경할 alias & 헤더 -> 확인해야되는 토큰
headers: {
Authorization: `${stringAccess.value}`,
},
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/components/chart/Date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
import { DatePicker } from "@mui/x-date-pickers/DatePicker";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import axios from "axios";
import { API_BASE_URL } from "src/utils/constants";
import { getAccess } from "../../Auth/tokenManager";
import { ReduxModule } from "../../modules/ReduxModule";
import Api from "../../utils/customApi";

const theme = createTheme({
palette: {
Expand Down Expand Up @@ -66,9 +65,9 @@ function Dates({ onClickRetrieve }: { onClickRetrieve: any }) {
const getDate = async () => {
const stringAccess: any = getAccess();
if (stringAccess !== null) {
await axios
await Api
.get(
`${API_BASE_URL}/trash/users/${userIdtoRedux}/statistics${periodStr}${startDateStr}${endDateStr}`, { //patch : 바디 -> 변경할 alias & 헤더 -> 확인해야되는 토큰
`/trash/users/${userIdtoRedux}/statistics${periodStr}${startDateStr}${endDateStr}`, { //patch : 바디 -> 변경할 alias & 헤더 -> 확인해야되는 토큰
headers: {
Authorization: `${stringAccess.value}`
}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/mainpage/TrashCardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ function MultiActionAreaCard() {
})
.catch((error) => {
});
getRanking();
}

React.useEffect(()=>{},[getRanking()]);

return (
<Grid container
sx={{ display: "flex", direction: "column", flexWrap: "wrap" }}
Expand Down

0 comments on commit 86bba2b

Please sign in to comment.