Skip to content

Commit

Permalink
chore: react-query 중복 설치 제거(#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgksqkr committed Jun 18, 2024
1 parent 881e47c commit 29e86cf
Show file tree
Hide file tree
Showing 6 changed files with 436 additions and 302 deletions.
94 changes: 2 additions & 92 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"react-icons": "^4.12.0",
"react-markdown": "^9.0.1",
"react-markdown-editor-lite": "^1.3.4",
"react-query": "^3.39.3",
"react-quill": "^2.0.0",
"react-responsive": "^9.0.2",
"react-select": "^5.8.0",
Expand Down
1 change: 1 addition & 0 deletions src/apis/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const getSearchResult = async (keyword: string): Promise<ISearchResult |
};
return searchResultList;
}

return { kind: 'searchResult', data };
};

Expand Down
4 changes: 1 addition & 3 deletions src/apis/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ const baseURL = process.env.NEXT_PUBLIC_SERVER_URL;

// 특정 문서의 전체 편집 목록 불러오기
export const getDocHistories = async (title: string) => {
console.log(title);
try {
const response = await axios.get(`${baseURL}history/${title}/`);
return response.data;
} catch (error) {
console.log(error);
return false;
console.error(error);
}
};
14 changes: 4 additions & 10 deletions src/hooks/useSearchForm.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';
import { useState } from 'react';

type SearchInputType = 'searchInput' | 'searchHeaderInput';

interface useFormProps {
initialValue: {
[k in SearchInputType]: string;
};
searchKeyword?: string;
initialValue: Record<SearchInputType, string>;
}

const useSearchForm = ({ initialValue, searchKeyword }: useFormProps) => {
const useSearchForm = ({ initialValue }: useFormProps) => {
const router = useRouter();
const [values, setValues] = useState(initialValue);

Expand Down Expand Up @@ -43,10 +41,6 @@ const useSearchForm = ({ initialValue, searchKeyword }: useFormProps) => {
}
};

useEffect(() => {
if (searchKeyword) setValues({ searchInput: searchKeyword, searchHeaderInput: '' });
}, [searchKeyword]);

return { values, isFocused, handleChange, handleSearchSubmit, handleFocus, handleBlur };
};

Expand Down
Loading

0 comments on commit 29e86cf

Please sign in to comment.