@szymonpiatek/nextwordpress 0.0.20 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1063,7 +1063,7 @@ declare class TIWishlistError extends Error {
1063
1063
  declare function createTIWishlistFetcher(config: TIWishlistConfig): {
1064
1064
  tiFetch: <T>(path: string, tags?: string[], options?: RequestInit) => Promise<T>;
1065
1065
  tiFetchGraceful: <T>(path: string, fallback: T, tags?: string[]) => Promise<T>;
1066
- tiMutate: <T>(path: string, body: unknown, method?: "POST") => Promise<T>;
1066
+ tiMutate: <T>(path: string, body: unknown, method?: "POST" | "DELETE") => Promise<T>;
1067
1067
  };
1068
1068
  type TIWishlistFetcher = ReturnType<typeof createTIWishlistFetcher>;
1069
1069
 
@@ -1078,7 +1078,7 @@ declare function createTIWishlistMutations(fetcher: TIWishlistFetcher): {
1078
1078
  updateWishlist: (shareKey: string, input: UpdateTIWishlistInput) => Promise<TIWishlist>;
1079
1079
  deleteWishlist: (shareKey: string) => Promise<string>;
1080
1080
  addProduct: (shareKey: string, input: AddProductToTIWishlistInput) => Promise<TIWishlistItem[]>;
1081
- removeProduct: (itemId: number) => Promise<string>;
1081
+ removeProduct: (shareKey: string, itemId: number) => Promise<string>;
1082
1082
  };
1083
1083
 
1084
1084
  interface OmnibusPriceEntry {
package/dist/index.d.ts CHANGED
@@ -1063,7 +1063,7 @@ declare class TIWishlistError extends Error {
1063
1063
  declare function createTIWishlistFetcher(config: TIWishlistConfig): {
1064
1064
  tiFetch: <T>(path: string, tags?: string[], options?: RequestInit) => Promise<T>;
1065
1065
  tiFetchGraceful: <T>(path: string, fallback: T, tags?: string[]) => Promise<T>;
1066
- tiMutate: <T>(path: string, body: unknown, method?: "POST") => Promise<T>;
1066
+ tiMutate: <T>(path: string, body: unknown, method?: "POST" | "DELETE") => Promise<T>;
1067
1067
  };
1068
1068
  type TIWishlistFetcher = ReturnType<typeof createTIWishlistFetcher>;
1069
1069
 
@@ -1078,7 +1078,7 @@ declare function createTIWishlistMutations(fetcher: TIWishlistFetcher): {
1078
1078
  updateWishlist: (shareKey: string, input: UpdateTIWishlistInput) => Promise<TIWishlist>;
1079
1079
  deleteWishlist: (shareKey: string) => Promise<string>;
1080
1080
  addProduct: (shareKey: string, input: AddProductToTIWishlistInput) => Promise<TIWishlistItem[]>;
1081
- removeProduct: (itemId: number) => Promise<string>;
1081
+ removeProduct: (shareKey: string, itemId: number) => Promise<string>;
1082
1082
  };
1083
1083
 
1084
1084
  interface OmnibusPriceEntry {
package/dist/index.js CHANGED
@@ -1061,8 +1061,8 @@ function createTIWishlistMutations(fetcher) {
1061
1061
  async function addProduct(shareKey, input) {
1062
1062
  return tiMutate(`${BASE4}/${shareKey}/add_product`, input);
1063
1063
  }
1064
- async function removeProduct(itemId) {
1065
- return tiFetch(`${BASE4}/remove_product/${itemId}`, ["ti-wishlist"]);
1064
+ async function removeProduct(shareKey, itemId) {
1065
+ return tiMutate(`${BASE4}/${shareKey}/remove_product/${itemId}`, {}, "DELETE");
1066
1066
  }
1067
1067
  return { createWishlist, updateWishlist, deleteWishlist, addProduct, removeProduct };
1068
1068
  }