Skip to content

Commit

Permalink
📝Update: api document
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen1264 committed Dec 10, 2024
1 parent 9eba9a3 commit f1692d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/widgets/main/api/getExpoList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import axios from 'axios';
import { ExpoItem } from '@/shared/types/Expo/type';

export const getExpoList = async (): Promise<ExpoItem[]> => {
const response = await axios.get('/api/expo');
return response.data;
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import axios from 'axios';
import { ExpoItem } from '@/shared/types/Expo/type';

const getExpoList = async (): Promise<ExpoItem[]> => {
const response = await axios.get('/api/expo');
return response.data;
};
import { getExpoList } from '../api/getExpoList';

export const useExpoList = () => {
return useQuery<ExpoItem[], Error>({
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/main/ui/ExpoListContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ExpoListItem, Filter } from '@/entities/main';
import withLoading from '@/shared/hocs/withLoading';
import { useExpoList } from '../../api/useExpoList';
import { useExpoList } from '../../model/useExpoList';

const ExpoListContainer = () => {
const { data: expoList, isLoading } = useExpoList();
Expand Down

0 comments on commit f1692d0

Please sign in to comment.