Skip to content

Commit 7831cca

Browse files
make api calls named exports
1 parent dfeed6c commit 7831cca

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

src/api/fetchFeedItems.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { RefObject, SetStateAction } from 'react'
22
import { FeedItemsType } from '@/types/types'
33
import { setItemInSessionStorage } from '@/utils/setItemInSessionStorage'
44

5-
const fetchFeedItems = async (
5+
export const fetchFeedItems = async (
66
nextPage: RefObject<number>,
77
PAGE_SIZE: number,
88
setFeedItems: (value: SetStateAction<FeedItemsType[]>) => void
@@ -41,5 +41,3 @@ const fetchFeedItems = async (
4141
console.error('An error occurred while fetching the comments.', error)
4242
}
4343
}
44-
45-
export default fetchFeedItems

src/api/fetchQuote.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Dispatch, SetStateAction } from 'react'
22
import { QuoteType } from '@/types/types'
33
import { setItemInSessionStorage } from '@/utils/setItemInSessionStorage'
44

5-
const fetchQuote = async (
5+
export const fetchQuote = async (
66
setQuote: Dispatch<SetStateAction<QuoteType | null>>
77
) => {
88
try {
@@ -32,5 +32,3 @@ const fetchQuote = async (
3232
console.error('An error occurred while fetching the quote.', error)
3333
}
3434
}
35-
36-
export default fetchQuote

src/api/fetchUsers.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { SetStateAction } from 'react'
22
import { UsersType } from '@/types/types'
33
import { setItemInSessionStorage } from '@/utils/setItemInSessionStorage'
44

5-
const fetchUsers = async (
5+
export const fetchUsers = async (
66
setUsers: (value: SetStateAction<UsersType[]>) => void
77
) => {
88
try {
@@ -32,5 +32,3 @@ const fetchUsers = async (
3232
console.error('An error occurred while fetching the users.', error)
3333
}
3434
}
35-
36-
export default fetchUsers

src/components/quote/Quote.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { useCallback, useContext, useEffect, useState } from 'react'
22
import { ContextContentLoaded } from '@/context/ContextContentLoaded'
33
import { ContextQuote } from '@/context/ContextQuote'
44
import { QuoteType } from '@/types/types'
5-
import fetchQuote from '@/api/fetchQuote'
65
import { Skeleton } from '@/components/ui/skeleton'
6+
import { fetchQuote } from '@/api/fetchQuote'
77
import { getItemFromSessionStorage } from '@/utils/getItemFromSessionStorage'
88

99
const Quote = () => {

src/components/users/Users.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import {
1414
CardTitle,
1515
} from '@/components/ui/card'
1616
import { Skeleton } from '@/components/ui/skeleton'
17-
import fetchUsers from '@/api/fetchUsers'
1817
import { ContextContentLoaded } from '@/context/ContextContentLoaded'
1918
import { ContextTopUsers } from '@/context/ContextTopUsers'
2019
import { UsersType } from '@/types/types'
20+
import { fetchUsers } from '@/api/fetchUsers'
2121
import { getItemFromSessionStorage } from '@/utils/getItemFromSessionStorage'
2222
import { useScreenWidth } from '@/hooks/useScreenWidth'
2323

0 commit comments

Comments
 (0)