Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #25

Merged
merged 2 commits into from
Nov 2, 2024
Merged

Fix #25

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/apis/instance.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import axios, { AxiosRequestConfig } from "axios";

const axiosConfig: AxiosRequestConfig = {
baseURL: "",
baseURL: "https://port-0-f4-back-m30e9x2h74f3a212.sel4.cloudtype.app/",
withCredentials: false,
// false를 통해 cross domain request 시 HTTP 인증 및 클라이언트 SSL 인증서 사용 허용
headers: {
"Content-Type": "application/json",
},
};

export const client = axios.create(axiosConfig);
export const instance = axios.create(axiosConfig);
6 changes: 3 additions & 3 deletions src/components/common/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import * as S from "./style";

interface InputProps {
label: string;
essential: boolean;
essential?: boolean;
hint: string;
value: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
value?: string;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
}

const Input: React.FC<InputProps> = ({
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useUserProfile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { AxiosResponse } from "axios";
import { client } from "@apis/instance";
import { instance } from "@apis/instance";

export const useUserProfile = () => {
const [response, setResponse] = useState<AxiosResponse | null>(null);
Expand All @@ -9,7 +9,7 @@ export const useUserProfile = () => {
const fetchData = async () => {
try {
// TODO - team_id 저장, profile id 저장
const response = await client.get(
const response = await instance.get(
"https://test.site/api/teams/{team_id}/profiles/{profile_id}"
);
setResponse(response);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Login: React.FC = () => {
paragraph="팀을 참가할 때 간단한 정보를 입력받아요."
/>
<InputForm>
<Input label="이름" essential hint="" />
<Input label="이름" hint="" />
<DateInput />
</InputForm>
</Container>
Expand Down