Skip to content

Commit

Permalink
feat: 알라딘 표지 품질 향상
Browse files Browse the repository at this point in the history
  • Loading branch information
2scent committed Jan 20, 2025
1 parent 48c55e7 commit d76ce53
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/pages/home/api/fetch-books.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,28 @@ export async function fetchBooks({ q }: FetchBooksParams) {
return data.item.map(adaptBookDTO);
}

const baseSearchParams = {
MaxResults: '10',
start: '1',
SearchTarget: 'Book',
Cover: 'Big',
output: 'js',
Version: '20131101',
};

function fetchNewBooks() {
const searchParams = new URLSearchParams({
...baseSearchParams,
QueryType: 'ItemNewAll',
MaxResults: '10',
start: '1',
SearchTarget: 'Book',
output: 'js',
Version: '20131101',
});

return aladinApi.get('ItemList.aspx', { searchParams });
}

function fetchSearchBooks(q: string) {
const searchParams = new URLSearchParams({
...baseSearchParams,
Query: q,
MaxResults: '10',
start: '1',
SearchTarget: 'Book',
output: 'js',
Version: '20131101',
});

return aladinApi.get('ItemSearch.aspx', { searchParams });
Expand Down

0 comments on commit d76ce53

Please sign in to comment.