-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: 사소한 에러 수정 * feat: 상품 리스트 get && 상품 선택 페이지 구현 중 * feat: 이것저것 수정 및 post 완성 * fix: 콘솔 삭제
- Loading branch information
1 parent
f011ea7
commit 128b99a
Showing
21 changed files
with
256 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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,24 @@ | ||
import { get } from "@apis/api"; | ||
import { QUERY_KEY } from "@apis/queryKeys/queryKeys"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { ApiResponseType } from "@types"; | ||
import { ProductList } from "src/stores/productList"; | ||
|
||
const getProductList = async (): Promise<ProductList | null> => { | ||
try { | ||
const response = await get< | ||
ApiResponseType<{ sailedProductList: ProductList }> | ||
>("api/v1/product/sailed"); | ||
return response.data.data.sailedProductList; | ||
} catch (error) { | ||
console.log(error); | ||
return null; | ||
} | ||
}; | ||
|
||
export const useFetchProductList = () => { | ||
return useQuery({ | ||
queryKey: [QUERY_KEY.PRODUCT_LIST], | ||
queryFn: () => getProductList(), | ||
}); | ||
}; |
This file contains 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,3 +1,4 @@ | ||
export const QUERY_KEY = { | ||
ORDER_POST: "orderPost", | ||
PRODUCT_LIST: "productList", | ||
} as const; |
This file contains 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 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -7,5 +7,4 @@ export const mainSectionStyle = css` | |
width: 100%; | ||
margin-top: 2.8rem; | ||
background-color: pink; | ||
`; |
Oops, something went wrong.