Skip to content

Commit

Permalink
#123 fix: 내 프로필 메뉴 별 상품 업로드 이슈 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunjun9788 committed Jun 19, 2024
1 parent 2138a20 commit b308b43
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import {

import { redirect } from 'next/navigation';
import { TAB_NAMES_ORIGIN } from '@/components/Profile/constants/productMenu';
import {
followerOptions,
productOptions,
profileOptions,
} from './queryOptions';
import { productOptions, profileOptions } from './queryOptions';

interface ProfileProps {
searchParams: {
Expand All @@ -33,7 +29,6 @@ export default function Profile({ searchParams }: ProfileProps) {
const currentMenu = searchParams.tab ?? TAB_NAMES_ORIGIN.reviewedProduct;
const queryClient = getQueryClient();
queryClient.prefetchQuery(profileOptions(Number(userId), accessToken));
queryClient.prefetchQuery(followerOptions(Number(userId), accessToken));

queryClient.prefetchInfiniteQuery(
productOptions(
Expand Down
1 change: 1 addition & 0 deletions src/app/profile/queryOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const productOptions = (
const response = await apiFunc(currentProfileId, pageParam);
return response.json();
},
staleTime: 0,
initialPageParam: 0,
getNextPageParam: (lastPage) => lastPage.nextCursor,
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/Profile/ProductSection/ProductList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface ProductListProps {
content: string;
}
export const ProductList = ({ productData, content }: ProductListProps) => {
const hasProduct = productData.pages[0].list.length;
const hasProduct = productData.pages[0].list.length > 0;
return hasProduct ? (
productData.pages.map((page) => (
<div
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/Img/ImageComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const typeClasses: Record<ImageProps['type'], string> = {
const sizesConfig: Record<ImageProps['type'], string> = {
product: '(max-width: 768px) 50vw, (max-width: 1024px) 80vw, 50vw',
profile: '(max-width: 768px) 36px, (max-width: 1024px) 36px, 33vw',
review: '(max-width: 768px) 60px, (max-width: 1024px) 80px, 100px',
review: '(max-width: 768px) 60px, (max-width: 1024px) 80px, 33vw',
detail: '(max-width: 768px) 335px, (max-width: 1024px) 280px, 355px',
};

Expand Down

0 comments on commit b308b43

Please sign in to comment.