Skip to content

Commit fd082fa

Browse files
committed
fix: API URL 변경
1 parent 610d0f9 commit fd082fa

File tree

11 files changed

+36
-27
lines changed

11 files changed

+36
-27
lines changed

package-lock.json

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"react-hook-form": "^7.49.3",
3838
"react-icons": "^4.12.0",
3939
"react-modal": "^3.16.1",
40-
"react-router-dom": "^6.21.1",
40+
"react-router-dom": "^6.22.3",
4141
"react-snap": "^1.23.0",
4242
"react-window": "^1.8.10",
4343
"styled-components": "^6.1.6",

src/apis/axiosInstance.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import {
77
STATUS_CODE,
88
} from "@constants/api";
99
import { PATH } from "@constants/path";
10+
import axios from "axios";
11+
12+
import { fetchNewToken } from "./fetchNewToken";
13+
1014
import type {
1115
AxiosError,
1216
AxiosRequestConfig,
1317
InternalAxiosRequestConfig,
1418
} from "axios";
15-
import axios from "axios";
16-
17-
import { fetchNewToken } from "./fetchNewToken";
1819

1920
export const axiosInstance = axios.create({
2021
baseURL: BASE_URL,

src/apis/fetchLogin.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { BASE_URL, END_POINTS } from "@/constants/api";
1+
import axios from "axios";
22

33
import type { EmailValidateData, LoginData } from "@type/login";
44
import type { ResponseData } from "@type/responseType";
5-
import axios from "axios";
5+
6+
import { BASE_URL, END_POINTS } from "@/constants/api";
67

78
interface LoginProps {
89
email: string;

src/constants/api.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
export const BASE_URL = "https://3.35.83.30.nip.io";
1+
export const BASE_URL = "https://43.200.52.7.nip.io";
22

33
export const END_POINTS = {
44
LOGIN: "/v1/members/signin",
55
LOGOUT: "/v1/members/logout",
66
SIGNUP: "/v1/members/signup",
77
ALARM: "/v1/alarms",
8+
PASSWORD: "/v1/members/password",
89
HASALARM: "/v1/alarms/status",
910
ROOM: (productId: string) => `/v1/products/${productId}`,
1011
RESERVATION: "/v1/reservations",

src/mocks/handler.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ export const handlers = [
4848
warning 없애기용.
4949
cdn에 폰트 요청하는걸 가로채지 못했다고 warning 띄우길래 적용했습니다.
5050
*/
51-
http.get("*", (req) => {
52-
console.log(req);
51+
http.get("*", () => {
5352
return;
5453
}),
5554
];

src/mocks/handlers/email.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { END_POINTS } from "@constants/api";
1+
import { BASE_URL, END_POINTS } from "@constants/api";
22
import { http, HttpResponse } from "msw";
33

44
export const getEmailVerification = (scenarioProps?: string) => {
5-
return http.post(`https://3.34.147.187.nip.io${END_POINTS.EMAIL}`, () => {
5+
return http.post(`${BASE_URL}${END_POINTS.EMAIL}`, () => {
66
const pageParams = new URLSearchParams(window.location.search);
77
const scenario = pageParams.get("scenario");
88

src/pages/passwordResetPage/components/passwordResetSubmitBtn.tsx/PasswordResetSubmitBtn.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { useNavigate } from "react-router-dom";
44

55
import * as S from "../../PasswordReset.style";
66

7+
import { BASE_URL, END_POINTS } from "@/constants/api";
8+
79
const PasswordResetSubmitBtn = () => {
810
const navigate = useNavigate();
911
const {
@@ -15,7 +17,7 @@ const PasswordResetSubmitBtn = () => {
1517
const handleOnSubmit = async () => {
1618
const data = getValues(["email", "password"]);
1719
await axios
18-
.patch("https://3.34.147.187.nip.io/v1/members/password", {
20+
.patch(`${BASE_URL}${END_POINTS.PASSWORD}`, {
1921
email: data[0],
2022
password: data[1],
2123
})

src/pages/signUpPage/components/signUpSubmitBtn/SignUpSubmitBtn.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { useNavigate } from "react-router-dom";
44

55
import * as S from "../../SignUp.style";
66

7+
import { BASE_URL, END_POINTS } from "@/constants/api";
8+
79
const SignUpSubmitBtn = () => {
810
const navigate = useNavigate();
911

@@ -23,7 +25,7 @@ const SignUpSubmitBtn = () => {
2325
"term2",
2426
]);
2527
await axios
26-
.post("https://3.34.147.187.nip.io/v1/members/signup", {
28+
.post(`${BASE_URL}${END_POINTS.SIGNUP}`, {
2729
email: data[0],
2830
password: data[1],
2931
name: data[2],

src/pages/transferWritingPricePage/inputSection/InputSection.style.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const Input = styled(motion.input)`
2525
box-shadow: 4px 4px 10px 0 rgba(0, 0, 0, 0.04);
2626
2727
text-align: center;
28+
/* padding-right: 40px; */
2829
transition: 0.2s;
2930
3031
&::placeholder {

tests/e2eTests/models/SignupPage.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Page } from "@playwright/test";
22

3+
import { BASE_URL, END_POINTS } from "@/constants/api";
4+
35
export class Signup {
46
page: Page;
57

@@ -56,7 +58,7 @@ export class Signup {
5658

5759
const response = await this.page.waitForResponse(
5860
(response) =>
59-
response.url() === "https://3.34.147.187.nip.io/v1/members/email" &&
61+
response.url() === `${BASE_URL}${END_POINTS.EMAIL}` &&
6062
response.status() === 200,
6163
);
6264

0 commit comments

Comments
 (0)