19 lines
537 B
TypeScript
19 lines
537 B
TypeScript
import { useFetch } from '../'
|
|
import { FiltersType } from '../../utils/filters'
|
|
import { composeAnnouncementsURL, initialAnnouncements, processAnnouncements } from '../../api/announcements'
|
|
|
|
import { isAnnouncementsResponse } from '../../api/announcements/types'
|
|
|
|
const useAnnouncements = (filters: FiltersType) => (
|
|
useFetch(
|
|
composeAnnouncementsURL(filters),
|
|
'GET',
|
|
false,
|
|
isAnnouncementsResponse,
|
|
processAnnouncements,
|
|
initialAnnouncements
|
|
)
|
|
)
|
|
|
|
export default useAnnouncements
|