-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 상단 태그 api 연결 (related to: #38)
- Loading branch information
1 parent
c07e851
commit 77dc30a
Showing
5 changed files
with
76 additions
and
10 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,16 @@ | ||
import { PARTNER_DOMAIN, REVIEW_MATE_URL } from '@/config/constant'; | ||
import axios from 'axios'; | ||
import { ProductDataType } from './types/reviewTypes'; | ||
|
||
export async function fetchProductData( | ||
productPartnerCustomId: string | ||
): Promise<ProductDataType> { | ||
try { | ||
const response = await axios.get( | ||
`${REVIEW_MATE_URL}/api/console/v1/${PARTNER_DOMAIN}/products/travel/single/${productPartnerCustomId}` | ||
); | ||
return response.data; | ||
} catch (error) { | ||
throw error; | ||
} | ||
} |
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,18 @@ | ||
export interface ProductDataType { | ||
id: number; | ||
partnerCustomId: string; | ||
thumbnailUrl: string; | ||
name: string; | ||
reviewsCount: number; | ||
rating: number; | ||
partnerSellerName: string; | ||
partnerSellerPhoneNumber: string; | ||
positiveTags: { | ||
category: string; | ||
count: number; | ||
}[]; | ||
negativeTags: { | ||
category: string; | ||
count: number; | ||
}[]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const productId = 'PRODUCT-0001' |