Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Getfiltered and getContents do not exist in useContent composition API [Bug]: #371

Open
1 task done
sleepon-official opened this issue Jul 11, 2022 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@sleepon-official
Copy link

Expected Behavior

According to in the document Sample code for:

import { onSSR } from '@vue-storefront/core';
import { useContent, contentGetters, useRoute } from '@vue-storefront/shopify';

export default {
  setup() {
    const route = useRoute();
    const { search, content } = useContent();
    const { slug } = route?.value?.params;

    onSSR(async () => {
      await search(slug);
    });

    const page = computed(() => contentGetters.getFiltered(content.value));

    return {
      page
    };
  }
};

The following functions should be performed according to the document prompts:

getFiltered - Retrieve the single page fetch by handle from Shopify store

getContents - Return the list of pages of Shopify store.

Actual Behavior

Unable to execute and error reported:
export 'contentGetters' was not found in '@vue-storefront/shopify'
Cannot read property 'getFiltered' of undefined

Possible Solution

Improve the getfiltered and getcontents methods mentioned in the document

Steps to reproduce

import { onSSR } from '@vue-storefront/core';
import { useContent, contentGetters, useRoute } from '@vue-storefront/shopify';

export default {
  setup() {
    const route = useRoute();
    const { search, content } = useContent();
    const { slug } = route?.value?.params;

    onSSR(async () => {
      await search(slug);
    });

    const page = computed(() => contentGetters.getFiltered(content.value));

    return {
      page
    };
  }
};

What version of shopify integration are you using?

1.1.2

What version of Node.js are you using?

14.17

What browser (and version) are you using?

Chrome v103.0.5060.114

What operating system (and version) are you using?

MacOs 11.6.5

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@sleepon-official sleepon-official added the bug Something isn't working label Jul 11, 2022
@Zavtramen
Copy link

Faced the same bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants