Skip to content

Commit

Permalink
Merge 89bf3c7 into 8cf19c3
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejewsky committed Jan 11, 2021
2 parents 8cf19c3 + 89bf3c7 commit 93d8a69
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 59 deletions.
1 change: 0 additions & 1 deletion packages/core/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ module.exports = {
children: [
['/integrate/integration-guide', 'Integration guide'],
['/general/cms', 'CMS'],
['/integrate/api-middleware', 'API middleware'],
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion packages/core/docs/commercetools/composables.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const customQuery = (query, variables) => {
variables: newVariables
}
}
search({ id: '12345' }, customQuery)

search({ id: '12345', customQuery })
```

Use it for: `useProduct`, `useCategory`, `useUser`, `useUserOrders` methods.
Expand Down
52 changes: 0 additions & 52 deletions packages/core/docs/integrate/api-middleware.md

This file was deleted.

10 changes: 5 additions & 5 deletions packages/core/docs/integrate/integration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ interface LineItem { /* ... */}
interface ProductVariant { /* ... */ }

const factoryParams: UseCartFactoryParams<Cart, LineItem, ProductVariant> = {
loadCart: async (context: Context) => {
load: async (context: Context) => {
const { data } = await context.$ct.api.getCart();

return data.cart;
},
addToCart: async (context: Context, params) => {
addItem: async (context: Context, params) => {
const { currentCart, product, quantity } = params;
const { data } = await context.$ct.api.addToCart(loadedCart, product, quantity, customQuery);

Expand Down Expand Up @@ -304,7 +304,7 @@ const factoryParams: UseUserFactoryParams = {
setup() {
return useCart();
},
loadUser: async (context: UserContext) => {
load: async (context: UserContext) => {
const { data } = await context.$ct.api.getUser();

context.setCart(data.activeCart);
Expand All @@ -329,7 +329,7 @@ const useCart = () => {
const cart = vsfRef(null, 'my-own-cart')
const context = generateContext(); // we do the job for you

const addToCart = async (product) => {
const addToCart = async ({ product }) => {
return context.$ownAPI.updateCart(product)
}

Expand Down Expand Up @@ -405,7 +405,7 @@ import { onSSR } from '@vue-storefront/core';

export default {
setup () {
const { cart, loadCart } = useCart();
const { cart, load: loadCart } = useCart();

const items = computed(() => cartGetters.getItems(cart.value))

Expand Down

0 comments on commit 93d8a69

Please sign in to comment.