1
1
import { CategoryResponse , DataAttributes } from '../types' ;
2
- import { APIResponseAcademic } from '../types/Academics' ;
3
2
import { APIResponseBlog } from '../types/Blogs' ;
4
3
import { APIResponseEvent } from '../types/Events' ;
5
4
import { MemberResponse } from '../types/Members' ;
6
- import { APIResponsePartner } from '../types/Partners ' ;
5
+ import { APIResponseSponsor } from '../types/Sponsors ' ;
7
6
8
7
import { CustomFetch } from './useFetch' ;
9
8
10
- const academics = ( customFetch : CustomFetch ) =>
11
- ( {
12
- academicCategoriesList : async ( ) => {
13
- const res = await customFetch ( 'CMS' , 'academic-categories' ) ;
14
- return res . data as DataAttributes < CategoryResponse > ;
15
- } ,
16
- academicsList : async ( ) => {
17
- const res = await customFetch ( 'CMS' , 'academics?populate=*' ) ;
18
- return res . data as APIResponseAcademic ;
19
- } ,
20
- } ) ;
21
-
22
9
const blogs = ( customFetch : CustomFetch ) =>
23
10
( {
24
- blogCategoriesList : async ( ) => {
25
- const res = await customFetch ( 'CMS' , 'blog-categories' ) ;
26
- return res . data as DataAttributes < CategoryResponse > ;
27
- } ,
28
11
blogsList : async ( ) => {
29
12
const res = await customFetch ( 'CMS' , 'blogs?populate=*' ) ;
30
13
return res . data as APIResponseBlog ;
@@ -33,43 +16,33 @@ const blogs = (customFetch: CustomFetch) =>
33
16
34
17
const events = ( customFetch : CustomFetch ) =>
35
18
( {
36
- eventCategoriesList : async ( ) => {
37
- const res = await customFetch ( 'CMS' , 'event-categories' ) ;
38
- return res . data as DataAttributes < CategoryResponse > ;
39
- } ,
40
19
eventsList : async ( ) => {
41
20
const res = await customFetch ( 'CMS' , 'events?populate=*' ) ;
42
21
return res . data as APIResponseEvent ;
43
22
} ,
44
23
} as const ) ;
45
24
46
- const members = ( customFetch : CustomFetch ) =>
47
- ( {
48
- membersList : async ( ) => {
49
- const res = await customFetch ( 'CMS' , 'team-members?populate=*' ) ;
50
- return res . data as DataAttributes < MemberResponse > ;
51
- } ,
52
- } ) ;
25
+ const members = ( customFetch : CustomFetch ) => ( {
26
+ membersList : async ( ) => {
27
+ const res = await customFetch ( 'CMS' , 'team-members?populate=*' ) ;
28
+ return res . data as DataAttributes < MemberResponse > ;
29
+ } ,
30
+ } ) ;
53
31
54
- const partners = ( customFetch : CustomFetch ) =>
32
+ const sponsors = ( customFetch : CustomFetch ) =>
55
33
( {
56
- partnerCategoriesList : async ( ) => {
57
- const res = await customFetch ( 'CMS' , 'partner-categories ' ) ;
58
- return res . data as DataAttributes < CategoryResponse > ;
34
+ sponsorsList : async ( ) => {
35
+ const res = await customFetch ( 'CMS' , 'sponsors?populate=* ' ) ;
36
+ return res . data as APIResponseSponsor ;
59
37
} ,
60
- partnersList : async ( ) => {
61
- const res = await customFetch ( 'CMS' , 'partners?populate=*' ) ;
62
- return res . data as APIResponsePartner ;
63
- } ,
64
- } ) ;
38
+ } as const ) ;
65
39
66
40
const config = ( customFetch : CustomFetch ) =>
67
41
( {
68
- ...academics ( customFetch ) ,
69
42
...blogs ( customFetch ) ,
70
43
...events ( customFetch ) ,
71
44
...members ( customFetch ) ,
72
- ...partners ( customFetch ) ,
45
+ ...sponsors ( customFetch ) ,
73
46
} as const ) ;
74
47
75
48
export default config ;
0 commit comments