Skip to content

Commit

Permalink
[fix] refetch 검색 안되는 문제 해결 (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimminkyeu authored Nov 19, 2024
1 parent 5713eac commit 8108af3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 2 additions & 3 deletions frontend/techpick/src/apis/pick/pickApi.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ import type { components } from '@/schema';
export type GetPickResponseType = Concrete<
components['schemas']['techpick.api.application.pick.dto.PickApiResponse$Pick']
>;
export type UpdatePickRequestType = Concrete<
components['schemas']['techpick.api.application.pick.dto.PickApiRequest$Update']
>;
export type UpdatePickRequestType =
components['schemas']['techpick.api.application.pick.dto.PickApiRequest$Update'];
9 changes: 8 additions & 1 deletion frontend/techpick/src/app/(signed)/folders/search/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useState } from 'react';
import { useEffect, useState } from 'react';
import { useSearchParams } from 'next/navigation';
import { PickListViewerInfiniteScroll } from '@/components/PickListViewer/PickListViewerInfiniteScroll';
import { usePickStore } from '@/stores/pickStore/pickStore';
Expand All @@ -11,6 +11,13 @@ export default function SearchPickResultPage() {
const { getSearchResult, searchPicksByQueryParam } = usePickStore();
const [pickList, setPickList] = useState<PickListType>([]);

useEffect(() => {
setPickList([]);
(async () => {
await loadNextSlice();
})(/*IIFE*/);
}, [searchParams]);

const loadNextSlice = async () => {
await searchPicksByQueryParam(
searchParams.toString(),
Expand Down
2 changes: 2 additions & 0 deletions frontend/techpick/src/stores/dndTreeStore/dndTreeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export const useTreeStore = create<TreeState & TreeAction>()(
parentFolderId: parentFolderId,
childFolderIdOrderedList: [],
folderType: 'GENERAL',
updatedAt: new Date().toDateString(), // TODO: 급하게 했습니다.. 꼭 고칩시다...
createdAt: new Date().toDateString(), // TODO: 급하게 했습니다.. 꼭 고칩시다...
};

const curChildFolderList =
Expand Down

0 comments on commit 8108af3

Please sign in to comment.