Skip to content

Commit ba50616

Browse files
committed
fix
1 parent 73f134b commit ba50616

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

.eslintrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": "next",
3+
"rules": {
4+
"react/no-unescaped-entities": "off",
5+
"@next/next/no-page-custom-font": "off"
6+
}
37
}

src/apis/search.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { AxiosResponse } from 'axios';
2+
import instance from './axiosInstance';
3+
4+
const SEARCH = {
5+
path: '/search',
6+
7+
//검색 페이지 불러오기 api [get]
8+
async getSearchPageApi(words: string): Promise<any> {
9+
const result: AxiosResponse = await instance.get(
10+
`${SEARCH.path}/all/count`,
11+
{
12+
params: {
13+
searchQuery: words,
14+
},
15+
},
16+
);
17+
return result.data;
18+
},
19+
};
20+
21+
export default SEARCH;

src/components/common/category/CategorySelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const CategorySelector = () => {
3333
<SelectOptions show={`${isOpenModal}`}>
3434
{categoryList.map((list) => {
3535
return (
36-
<div>
37-
<Option key={list.id} onClick={handleOnChangeSelectValue}>
36+
<div key={list.id}>
37+
<Option onClick={handleOnChangeSelectValue}>
3838
{list.category}
3939
</Option>
4040
</div>

src/components/organisms/help-board/HelpBoardCardList.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
import SEARCH from '@/apis/search';
12
import HelpCard from '@/components/molecules/help-board-elements/HelpCard';
23
import { useEffect, useState } from 'react';
34
import styled from 'styled-components';
45

56
const HelpBoardCardList = () => {
67
//api요청
8+
const getHelpListApi = async () => {
9+
const response = await SEARCH.getSearchPageApi;
10+
};
711

812
return (
913
<HelpCardWrapper>

src/components/templates/HelpTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import SubPageHeader from '@/components/common/header/SubPageHeader';
2-
import HelpBoardCardList from '../organisms/help-board/HelpBoardCard';
2+
import HelpBoardCardList from '../organisms/help-board/HelpBoardCardList';
33
import Link from 'next/link';
44
import Category from '../common/category/Category';
55

0 commit comments

Comments
 (0)