Skip to content

Commit

Permalink
update async
Browse files Browse the repository at this point in the history
  • Loading branch information
jendiamond committed Sep 7, 2023
1 parent 8fdd8d5 commit c365ddc
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions pages/collections/access/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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", {}),
}
Expand Down

0 comments on commit c365ddc

Please sign in to comment.