Improve template API calls prefetching in the email editor
When we don't know template we prefetch recent emails for recent emails tab to open faster, and in case the template is known, we prefetch the template. [MAILPOET-6370]
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
b98342c295
commit
7bca42a32e
@@ -214,9 +214,14 @@ class EditorPageRenderer {
|
||||
'/wp/v2/settings',
|
||||
'/wp/v2/types?context=view',
|
||||
'/wp/v2/taxonomies?context=view',
|
||||
'/wp/v2/templates/lookup?slug=' . $templateSlug,
|
||||
];
|
||||
|
||||
if ($templateSlug) {
|
||||
$routes[] = '/wp/v2/templates/lookup?slug=' . $templateSlug;
|
||||
} else {
|
||||
$routes[] = '/wp/v2/mailpoet_email?context=edit&per_page=30&status=publish,sent';
|
||||
}
|
||||
|
||||
// Preload the data for the specified routes
|
||||
$preloadData = array_reduce(
|
||||
$routes,
|
||||
|
Reference in New Issue
Block a user