-
Notifications
You must be signed in to change notification settings - Fork 37
[박나겸] Sprint 7 #312
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
Merged
withyj-codeit
merged 9 commits into
codeit-bootcamp-frontend:React-박나겸
from
nagyum:React-박나겸-sprint7
Feb 3, 2025
The head ref may contain hidden characters: "React-\uBC15\uB098\uACB8-sprint7"
Merged
[박나겸] Sprint 7 #312
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d93b3d2
코드리뷰 수정
nagyum 7523e2a
chore: 페이지네이션
nagyum 7f9d368
폴더 구조 변경으로 인한 수정/삭제
nagyum 14695a1
comment와 detailPage를 위한 API 등록
nagyum ec4badf
폴더 구조 변경으로 인한 수정/삭제
nagyum 0b16eee
폴더 구조 변경으로 인한 수정/삭제
nagyum 1e519d6
상품등록하기 태그 오류 수정
nagyum 5f516c6
화면 UI 수정
nagyum ce50d73
상품 상세 페이지 UI 수정
nagyum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { BrowserRouter, Route, Routes } from "react-router-dom"; | ||
import ProductPage from "./components/ProductPage/ProductPage"; | ||
import ItemPage from "./components/ItemPage/ItemPage"; | ||
import AddItem from "./components/AddItemPage/AddItemPage"; | ||
import NavBar from "./components/Nav/NavBar"; | ||
|
||
function App() { | ||
return ( | ||
<BrowserRouter> | ||
<NavBar /> | ||
<Routes> | ||
<Route path="/items" element={<ProductPage />} /> | ||
<Route path="/items/:id" element={<ItemPage />} /> | ||
<Route path="/additem" element={<AddItem />} /> | ||
</Routes> | ||
</BrowserRouter> | ||
); | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,38 @@ | ||
const BASE_URL = "https://panda-market-api.vercel.app"; | ||
|
||
export async function getData({ page = 1, pageSize = 4, orderBy = "recent" }) { | ||
const query = `page=${page}&pageSize=${pageSize}&orderBy=${orderBy}`; | ||
const response = await fetch(`${BASE_URL}/products?${query}`); | ||
const body = response.json(); | ||
return body; | ||
const url = new URL("/products", BASE_URL); | ||
url.searchParams.append("page", page); | ||
url.searchParams.append("pageSize", pageSize); | ||
url.searchParams.append("orderBy", orderBy); | ||
|
||
const response = await fetch(url.toString()); | ||
if (!response.ok) { | ||
throw new Error(`Failed to fetch data: ${response.statusText}`); | ||
} | ||
return response.json(); | ||
} | ||
|
||
//GET product ID | ||
export async function getProductDetail(id) { | ||
const url = new URL(`/products/${id}`, BASE_URL); | ||
// url.searchParams.append("{id}", id); | ||
|
||
const response = await fetch(url.toString()); | ||
if (!response.ok) { | ||
throw new Error(`Failed to fetch data: ${response.statusText}`); | ||
} | ||
return response.json(); | ||
} | ||
|
||
//GET 상세페이지 댓글들 | ||
|
||
export async function getProductComment(id, limit = 3) { | ||
const url = new URL(`/products/${id}/comments`, BASE_URL); | ||
url.searchParams.append("limit", limit); | ||
const response = await fetch(url.toString()); | ||
if (!response.ok) { | ||
throw new Error(`Failed to fetch data: ${response.statusText}`); | ||
} | ||
return response.json(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"text"를 넣거나 "text"가 기본값이니까 생략해야 하는데 잘못 넣으신 거죠?