From c365ddc691b91f03a16d8a47a3aa10feac54eefb Mon Sep 17 00:00:00 2001 From: jendiamond Date: Thu, 7 Sep 2023 10:46:19 -0700 Subject: [PATCH] update async --- pages/collections/access/index.vue | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/pages/collections/access/index.vue b/pages/collections/access/index.vue index cc6e1e46f..35156a84f 100644 --- a/pages/collections/access/index.vue +++ b/pages/collections/access/index.vue @@ -72,8 +72,6 @@ export default { async asyncData({ $graphql, $elasticsearchplugin }) { console.log("In asyncData hook collectionsAccess list") - collection.to = collection.uri ? collection.uri : collection.externalResourceUrl - const pageAsyncData = await $graphql.default.request(ACCESS_COLLECTIONS) if ( @@ -85,26 +83,22 @@ export default { /*console.log( "External Resource indexing:" + externalResource.slug )*/ + collection.searchType = "accessCollections" + collection.to = collection.uri ? collection.uri : collection.externalResourceUrl + collection.category = + collection.workshopOrEventSeriesType === "help/services-resources" + ? "workshop" + : collection.serviceOrResourceType + ? collection.serviceOrResourceType + : collection.typeHandle === "externalResource" + ? "resource" + : collection.typeHandle === "generalContentPage" + ? "resource" + : collection.typeHandle await $elasticsearchplugin.index(collection, collection.slug) } } - pageAsyncData.entry.accessCollections.forEach((collection) => { - collection.searchType = "accessCollections" - collection.to = collection.uri ? collection.uri : collection.externalResourceUrl - collection.category = - collection.workshopOrEventSeriesType === "help/services-resources" - ? "workshop" - : collection.serviceOrResourceTypej - ? collection.serviceOrResourceType - : collection.typeHandle === "externalResource" - ? "resource" - : collection.typeHandle === "generalContentPage" - ? "resource" - : collection.typeHandle - await $elasticsearchplugin.index(collection, collection.slug) - }) - return { page: _get(pageAsyncData, "entry", {}), }