Updated urls to the API

This commit is contained in:
Luis Alvarez
2021-05-25 21:53:04 -05:00
parent cf9b341dc9
commit 746028f25b
11 changed files with 16 additions and 19 deletions

View File

@@ -9,7 +9,7 @@ export default useLogin as UseLogin<typeof handler>
export const handler: MutationHook<LoginHook> = {
fetchOptions: {
url: '/api/bigcommerce/customers/login',
url: '/api/login',
method: 'POST',
},
async fetcher({ input: { email, password }, options, fetch }) {

View File

@@ -8,7 +8,7 @@ export default useLogout as UseLogout<typeof handler>
export const handler: MutationHook<LogoutHook> = {
fetchOptions: {
url: '/api/bigcommerce/customers/logout',
url: '/api/logout',
method: 'GET',
},
useHook: ({ fetch }) => () => {

View File

@@ -9,7 +9,7 @@ export default useSignup as UseSignup<typeof handler>
export const handler: MutationHook<SignupHook> = {
fetchOptions: {
url: '/api/bigcommerce/customers/signup',
url: '/api/signup',
method: 'POST',
},
async fetcher({

View File

@@ -9,7 +9,7 @@ export default useAddItem as UseAddItem<typeof handler>
export const handler: MutationHook<AddItemHook> = {
fetchOptions: {
url: '/api/bigcommerce/cart',
url: '/api/cart',
method: 'POST',
},
async fetcher({ input: item, options, fetch }) {

View File

@@ -7,7 +7,7 @@ export default useCart as UseCart<typeof handler>
export const handler: SWRHook<GetCartHook> = {
fetchOptions: {
url: '/api/bigcommerce/cart',
url: '/api/cart',
method: 'GET',
},
useHook: ({ useData }) => (input) => {

View File

@@ -20,7 +20,7 @@ export default useRemoveItem as UseRemoveItem<typeof handler>
export const handler = {
fetchOptions: {
url: '/api/bigcommerce/cart',
url: '/api/cart',
method: 'DELETE',
},
async fetcher({

View File

@@ -6,7 +6,7 @@ import type {
} from '@commerce/utils/types'
import { ValidationError } from '@commerce/utils/errors'
import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item'
import type { LineItem, UpdateItemHook } from '../types'
import type { LineItem, UpdateItemHook } from '../types/cart'
import { handler as removeItemHandler } from './use-remove-item'
import useCart from './use-cart'
@@ -18,7 +18,7 @@ export default useUpdateItem as UseUpdateItem<typeof handler>
export const handler = {
fetchOptions: {
url: '/api/bigcommerce/cart',
url: '/api/cart',
method: 'PUT',
},
async fetcher({

View File

@@ -8,7 +8,7 @@ export default useWishlist as UseWishlist<typeof handler>
export const handler: SWRHook<GetWishlistHook> = {
fetchOptions: {
url: '/api/bigcommerce/wishlist',
url: '/api/wishlist',
method: 'GET',
},
async fetcher({ input: { customerId, includeProducts }, options, fetch }) {