From 2e99da6910f268466d642b11dacab0921b277375 Mon Sep 17 00:00:00 2001 From: mkucmus Date: Tue, 10 Mar 2020 16:50:26 +0100 Subject: [PATCH] fix(theme): 502 on composition-api error (#478) --- .travis.yml | 2 ++ packages/composables/src/hooks/useProductListing.ts | 5 +---- .../components/cms/elements/SwCategoryNavigationSlot.vue | 2 +- packages/default-theme/pages/_.vue | 5 ++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae94d7d39..15b908d38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,8 @@ install: - yarn jobs: + allow_failures: + - os: windows include: - stage: Test script: diff --git a/packages/composables/src/hooks/useProductListing.ts b/packages/composables/src/hooks/useProductListing.ts index e786f0b99..99897610e 100644 --- a/packages/composables/src/hooks/useProductListing.ts +++ b/packages/composables/src/hooks/useProductListing.ts @@ -52,14 +52,11 @@ const selectedCriteria = Vue.observable({ export const useProductListing = ( initialProducts: Product[] = [] ): UseProductListing => { - const { page } = useCms(); + const { categoryId } = useCms(); const { activeSorting } = useCategoryFilters(); const loading: Ref = ref(false); const error: Ref = ref(null); - const categoryId: Ref = ref( - page && page.value && page.value.resourceIdentifier - ); const localListing = reactive(sharedListing); const localCriteria = reactive(selectedCriteria); const localPagination = reactive(sharedPagination); diff --git a/packages/default-theme/components/cms/elements/SwCategoryNavigationSlot.vue b/packages/default-theme/components/cms/elements/SwCategoryNavigationSlot.vue index 7a5f3536d..ab513899e 100644 --- a/packages/default-theme/components/cms/elements/SwCategoryNavigationSlot.vue +++ b/packages/default-theme/components/cms/elements/SwCategoryNavigationSlot.vue @@ -58,7 +58,7 @@ export default { setup() { const { categoryId } = useCms() - return { categoryId: categoryId.value } + return { categoryId } }, data() { return { diff --git a/packages/default-theme/pages/_.vue b/packages/default-theme/pages/_.vue index 37941829e..85236e30f 100644 --- a/packages/default-theme/pages/_.vue +++ b/packages/default-theme/pages/_.vue @@ -23,7 +23,7 @@ export default { components: { }, asyncData: async ({ req, params, query, error: errorView }) => { - const {search, page, category, error} = useCms() + const {search, page, error} = useCms() const {refreshCart} = useCart() const {refreshUser} = useUser() // TODO fix this after meeting @@ -49,8 +49,7 @@ export default { cmsPageName: name, page: unwrappedPage, breadcrumbs, - cmsPage, - category + cmsPage } }, data() {