Skip to content

Commit

Permalink
Merge pull request #74 from spree/fix/add-cart-path
Browse files Browse the repository at this point in the history
Use storefront path for add to cart endpoint
  • Loading branch information
Tomek Niezgoda committed Mar 29, 2019
2 parents b97825d + 0347635 commit 4bfb2e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/routes.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const storefrontPath = `api/v2/storefront`

export const Routes = {
productsPath: () =>`${storefrontPath}/products`,
productsPath: () => `${storefrontPath}/products`,
productPath: (id: string) => `${storefrontPath}/products/${id}`,
taxonsPath: () => `${storefrontPath}/taxons`,
taxonPath: (id: string) => `${storefrontPath}/taxons/${id}`,
countriesPath: () => `${storefrontPath}/countries`,
countryPath: (iso: string) => `${storefrontPath}/countries/${iso}`,
cartPath: () => `${storefrontPath}/cart`,
cartAddItemPath: () => `cart/add_item`,
cartAddItemPath: () => `${storefrontPath}/cart/add_item`,
cartRemoveItemPath: (id: string) => `${storefrontPath}/cart/remove_line_item/${id}`,
cartEmptyPath: () => `${storefrontPath}/cart/empty`,
cartSetItemQuantity: () => `${storefrontPath}/cart/set_quantity`,
Expand All @@ -27,6 +27,6 @@ export const Routes = {
accountCreditCardsPath: () => `${storefrontPath}/account/credit_cards`,
accountDefaultCreditCardPath: () => `${storefrontPath}/account/credit_cards/default`,
accountCompletedOrdersPath: () => `${storefrontPath}/account/orders`,
accountCompletedOrderPath: (number: string) => `${storefrontPath}/account/orders/${number}`,
orderStatusPath: (number: string) => `${storefrontPath}/order_status/${number}`
accountCompletedOrderPath: (orderNumber: string) => `${storefrontPath}/account/orders/${orderNumber}`,
orderStatusPath: (orderNumber: string) => `${storefrontPath}/order_status/${orderNumber}`
}
4 changes: 2 additions & 2 deletions types/routes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export declare const Routes: {
accountCreditCardsPath: () => string;
accountDefaultCreditCardPath: () => string;
accountCompletedOrdersPath: () => string;
accountCompletedOrderPath: (number: string) => string;
orderStatusPath: (number: string) => string;
accountCompletedOrderPath: (orderNumber: string) => string;
orderStatusPath: (orderNumber: string) => string;
};

0 comments on commit 4bfb2e6

Please sign in to comment.