Skip to content

Commit

Permalink
Merge branch 'dev' into feat/#106
Browse files Browse the repository at this point in the history
  • Loading branch information
chundang authored Aug 23, 2024
2 parents fbdade6 + 3b41fc1 commit a78dab9
Show file tree
Hide file tree
Showing 58 changed files with 3,327 additions and 2,223 deletions.
13 changes: 9 additions & 4 deletions FITple-Frontend/assets/ClosetEmpty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FITple-Frontend/assets/RecomImg/user (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FITple-Frontend/assets/RecomImg/user (2).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FITple-Frontend/assets/RecomImg/user (3).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FITple-Frontend/assets/RecomImg/user (4).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FITple-Frontend/assets/RecomImg/user (5).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FITple-Frontend/assets/RecomImg/user (6).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion FITple-Frontend/data/ClothApi.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
const localhost = "http://localhost:3000";

export const ClothApi = async () => {
export const ClothApi = async (category, cursorId, size) => {
try {
const url = new URL(`${localhost}/FITple/my/closet/main`);

// 쿼리 파라미터 추가
if (category !== undefined) url.searchParams.append("category", category);
if (cursorId !== undefined) url.searchParams.append("cursorId", cursorId);
if (size !== undefined) url.searchParams.append("size", size);

const response = await fetch(url, {
method: "GET",
credentials: "include",
Expand Down
22 changes: 0 additions & 22 deletions FITple-Frontend/data/DeleteApi.jsx

This file was deleted.

9 changes: 2 additions & 7 deletions FITple-Frontend/data/GetProfileApi.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
const localhost = "http://localhost:3000";

export const getProfile = async (category, cursorId, size) => {
export const getProfile = async () => {
try {
const url = new URL(`${localhost}/FITple/my/closet/main`);

// 쿼리 파라미터 추가
if (category !== undefined) url.searchParams.append("category", category);
if (cursorId !== undefined) url.searchParams.append("cursorId", cursorId);
if (size !== undefined) url.searchParams.append("size", size);
const url = new URL(`${localhost}/FITple/profile`);

const response = await fetch(url, {
method: "GET",
Expand Down
21 changes: 21 additions & 0 deletions FITple-Frontend/data/ProfileBodyApi.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const localhost = "http://localhost:3000";

export const ProfileBodyApi = async () => {
try {
const url = new URL(`${localhost}/FITple/profile/body_info`);

const response = await fetch(url, {
method: "GET",
credentials: "include",
});

if (!response.ok) {
throw new Error(`서버 오류: ${response.status}`);
}

return await response.json();
} catch (error) {
console.error("검색 요청 중 오류가 발생했습니다.", error);
throw new Error("네트워크 오류가 발생했습니다. 잠시 후 다시 시도해주세요.");
}
};
21 changes: 21 additions & 0 deletions FITple-Frontend/data/ProfileFavorApi.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const localhost = "http://localhost:3000";

export const ProfileFavorApi = async (category) => {
try {
const url = new URL(`${localhost}/FITple/profile/wish`);
if (category) url.searchParams.append("category", category);
const response = await fetch(url, {
method: "GET",
credentials: "include",
});

if (!response.ok) {
throw new Error(`서버 오류: ${response.status}`);
}

return await response.json();
} catch (error) {
console.error("검색 요청 중 오류가 발생했습니다.", error);
throw new Error("네트워크 오류가 발생했습니다. 잠시 후 다시 시도해주세요.");
}
};
21 changes: 21 additions & 0 deletions FITple-Frontend/data/ProfileLoveApi.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const localhost = "http://localhost:3000";

export const ProfileLoveApi = async (category) => {
try {
const url = new URL(`${localhost}/FITple/profile/likes`);
if (category) url.searchParams.append("category", category);
const response = await fetch(url, {
method: "GET",
credentials: "include",
});

if (!response.ok) {
throw new Error(`서버 오류: ${response.status}`);
}

return await response.json();
} catch (error) {
console.error("검색 요청 중 오류가 발생했습니다.", error);
throw new Error("네트워크 오류가 발생했습니다. 잠시 후 다시 시도해주세요.");
}
};
22 changes: 22 additions & 0 deletions FITple-Frontend/data/RecomFeedApi.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const RecomFeedApi = async () => {
try {
const response = await fetch('/TestData/ItemTestData.json', {
method: 'GET',
credentials: 'include',
});

// 응답 상태가 정상인지 확인
if (!response.ok) {
throw new Error(`Network response was not ok: ${response.statusText}`);
}

const data = await response.json();
return data; // 필요에 따라 데이터를 반환합니다.
} catch (error) {
console.error('There has been a problem with your fetch operation:', error);
return null; // 오류 발생 시 null 반환
}
};

export default RecomFeedApi; // default 내보내기

44 changes: 44 additions & 0 deletions FITple-Frontend/data/RecomMainApi.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// const localhost = "http://localhost:3000";

// export const ClothApi = async (category, cursorId, size) => {
// try {
// const url = new URL(`${localhost}/FITple/my/closet/main`);

// // 쿼리 파라미터 추가
// if (category !== undefined) url.searchParams.append("category", category);
// if (cursorId !== undefined) url.searchParams.append("cursorId", cursorId);
// if (size !== undefined) url.searchParams.append("size", size);

// const response = await fetch(url, {
// method: "GET",
// credentials: "include",
// });

// if (!response.ok) {
// throw new Error(`서버 오류: ${response.status}`);
// }
// const data = await response.json()
// return data;
// } catch (error) {
// console.error("검색 요청 중 오류가 발생했습니다.", error);
// throw new Error("네트워크 오류가 발생했습니다. 잠시 후 다시 시도해주세요.");
// }
// };

export const RecomMainApi = async () => {
try {
const response = await fetch('/TestData/UserTestData.json', { // JSON 파일의 경로를 설정합니다.
method: 'GET',
credentials: 'include', // 쿠키를 포함하여 요청합니다.
});

if (!response.ok) {
throw new Error('Network response was not ok');
}

const data = await response.json(); // 응답을 JSON으로 변환합니다.
return data; // 필요에 따라 데이터를 반환합니다.
} catch (error) {
console.error('There has been a problem with your fetch operation:', error);
}
};
28 changes: 28 additions & 0 deletions FITple-Frontend/data/TestApi.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const localhost = "http://localhost:3000";

const TestApi = async (category, cursorId, size) => {
try {
const url = new URL(`${localhost}/FITple/my/closet/main`);

// 쿼리 파라미터 추가
if (category !== undefined) url.searchParams.append("category", category);
if (cursorId !== undefined) url.searchParams.append("cursorId", cursorId);
if (size !== undefined) url.searchParams.append("size", size);

const response = await fetch(url, {
method: "GET",
credentials: "include",
});

if (!response.ok) {
throw new Error(`서버 오류: ${response.status}`);
}
const data = await response.json();
return data;
} catch (error) {
console.error("검색 요청 중 오류가 발생했습니다.", error);
throw new Error("네트워크 오류가 발생했습니다. 잠시 후 다시 시도해주세요.");
}
};

export default TestApi
26 changes: 0 additions & 26 deletions FITple-Frontend/data/UpdateApi.jsx

This file was deleted.

9 changes: 9 additions & 0 deletions FITple-Frontend/data/store/store.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from 'zustand';

const useAuthStore = create((set) => ({
token: null,
setToken: (newToken) => set({ token: newToken }),
clearToken: () => set({ token: null }),
}));

export default useAuthStore;
Loading

0 comments on commit a78dab9

Please sign in to comment.