Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
plugins
/
yith-woocommerce-wishlist
/
assets
/
js
/
src
/
utils
:
wishlist-api.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import apiFetch from '@wordpress/api-fetch'; class WishlistApiHandler { async fetchWishlists() { return await apiFetch( { path: '/yith/wishlist/v1/lists/', } ); } async createWishlists( data ) { const response = await apiFetch( { path: '/yith/wishlist/v1/lists/', method: 'POST', data } ); if ( false === response?.success ) { throw new Error( response?.message ); } return response; } } export default new WishlistApiHandler();