Skip to content

Commit b13dc1b

Browse files
authored
Forms: Add filters to preload registration (#45454)
1 parent bb49e45 commit b13dc1b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: changed
3+
4+
Forms: fix preload middleware registration to properly cache API requests and support both path formats.

projects/packages/forms/src/dashboard/class-dashboard.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,15 @@ public function load_admin_scripts() {
101101
),
102102
'/wp/v2/feedback'
103103
);
104+
$filters_path = '/wp/v2/feedback/filters';
105+
$filters_locale_path = \add_query_arg( array( '_locale' => 'user' ), $filters_path );
104106
$preload_paths = array(
105107
'/wp/v2/types?context=view',
106108
'/wp/v2/feedback/config',
107109
'/wp/v2/feedback/integrations?version=2',
108110
'/wp/v2/feedback/counts',
109-
'/wp/v2/feedback/filters',
111+
$filters_path,
112+
$filters_locale_path,
110113
$initial_responses_path,
111114
$initial_responses_locale_path,
112115
);

projects/packages/forms/src/dashboard/store/resolvers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const getFilters =
66
() =>
77
async ( { dispatch } ) => {
88
const results = await apiFetch( {
9-
path: 'wp/v2/feedback/filters',
9+
path: '/wp/v2/feedback/filters',
1010
} );
1111
dispatch.receiveFilters( results );
1212
};

0 commit comments

Comments
 (0)