Skip to content

Commit

Permalink
Refactor : get url 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ncb6206 committed Jan 16, 2024
1 parent 8fa2062 commit 27059c5
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/service/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ export const GET = async ({ type, pagesize, currentpage }: IPageParams) => {
try {
const actSize = pagesize ?? 0;
const actPage = currentpage ?? 0;
const response = await instance.get(`/v1/search/shop.json`, {
params: {
query: '신발',
display: actSize,
start: actPage,
sort: 'sim',
filter: 'medium',
const response = await instance.get(
`https://openapi.naver.com/v1/search/shop.json`,
{
params: {
query: '신발',
display: actSize,
start: actPage,
sort: 'sim',
filter: 'medium',
},
headers: {
'X-Naver-Client-Id': 'uyMURTnvXMhM8p07GkHJ',
'X-Naver-Client-Secret': 'mT42P9gciB',
},
},
headers: {
'X-Naver-Client-Id': 'uyMURTnvXMhM8p07GkHJ',
'X-Naver-Client-Secret': 'mT42P9gciB',
},
});
);

if (type === 'length') return response.data.items.length;

Expand Down

0 comments on commit 27059c5

Please sign in to comment.