File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change
1
+ Significance: patch
2
+ Type: changed
3
+
4
+ Forms: optimize inbox data loading with _fields parameter to reduce payload size.
Original file line number Diff line number Diff line change @@ -47,6 +47,22 @@ interface UseInboxDataReturn {
47
47
filterOptions : Record < string , unknown > ;
48
48
}
49
49
50
+ const RESPONSE_FIELDS = [
51
+ 'id' ,
52
+ 'status' ,
53
+ 'date' ,
54
+ 'date_gmt' ,
55
+ 'author_name' ,
56
+ 'author_email' ,
57
+ 'author_url' ,
58
+ 'author_avatar' ,
59
+ 'ip' ,
60
+ 'entry_title' ,
61
+ 'entry_permalink' ,
62
+ 'has_file' ,
63
+ 'fields' ,
64
+ ] . join ( ',' ) ;
65
+
50
66
/**
51
67
* Hook to get all inbox related data.
52
68
*
@@ -73,7 +89,10 @@ export default function useInboxData(): UseInboxDataReturn {
73
89
isResolving : isLoadingRecordsData ,
74
90
totalItems,
75
91
totalPages,
76
- } = useEntityRecords ( 'postType' , 'feedback' , currentQuery ) ;
92
+ } = useEntityRecords ( 'postType' , 'feedback' , {
93
+ ...currentQuery ,
94
+ _fields : RESPONSE_FIELDS ,
95
+ } ) ;
77
96
78
97
const records = ( rawRecords || [ ] ) as FormResponse [ ] ;
79
98
You can’t perform that action at this time.
0 commit comments