Skip to content

Commit

Permalink
TypeMapping 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
guswl98 committed Aug 5, 2024
1 parent e220e21 commit 6645ff6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/react-contexts/src/images-context/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ const Context = createContext<ImagesContext>({
},
})

const TYPE_MAPPING = {
attraction: 'poi',
restaurant: 'poi',
hotel: 'hotel',
}

export function ImagesProvider({
images: defaultImages,
total: initialTotal,
Expand All @@ -83,7 +77,7 @@ export function ImagesProvider({
const sendFetchRequest = useCallback(
async (size = 15) => {
const response = await fetchImages({
target: { type: TYPE_MAPPING[type] || type, id },
target: { type, id },
currentImageLength: images.length - (defaultImages?.length || 0),
size,
categoryOrder,
Expand All @@ -107,7 +101,7 @@ export function ImagesProvider({
total,
next,
} = await fetchImages({
target: { type: TYPE_MAPPING[type] || type, id },
target: { type, id },
currentImageLength: 0,
size: 15,
categoryOrder,
Expand Down

0 comments on commit 6645ff6

Please sign in to comment.