1var wishlistAPI = { 2 token: null, 3 setToken: function(token) { 4 if (token) { 5 this.token = token; 6 } 7 }, 8 getAxiosInstance: function() { 9 if (window.knobby && window.knobby.module_website_vue_use_one_lib_for_all_places) { 10 const config = {}; 11 if (this.token) { 12 config.headers = { 13 Authorization: 'Bearer ' + this.token, 14 }; 15 } 16 return axios.create(config); 17 } else { 18 let instance = axios.create(); 19 if (this.token) { 20 instance.defaults.headers.common['Authorization'] = 'Bearer ' + this.token; 21 } 22 return instance; 23 } 24 }, 25 create: function(data) { 26 let instance = this.getAxiosInstance(); 27 return instance.post("/api/wishlist/list", data).then(function(response) { 28 return Promise.resolve(response.data.list); 29 }); 30 }, 31 update: function(data) { 32 var instance = this.getAxiosInstance(); 33 return instance.put("/api/wishlist/list/" + data.wishlist_id, data).then(function(response) { 34 return Promise.resolve(response.data.list); 35 }); 36 }, 37 addItem: function(data) { 38 let instance = this.getAxiosInstance(); 39 return instance.post("/api/wishlist/item/", data).then(function(response) { 40 return Promise.resolve(); 41 }); 42 }, 43 deleteItem: function(itemId) { 44 let instance = this.getAxiosInstance(); 45 return instance.delete("/api/wishlist/item/" + itemId).then(function(response) { 46 return Promise.resolve(); 47 }); 48 }, 49 updateItem: function(data) { 50 let instance = this.getAxiosInstance(); 51 return instance.put("/api/wishlist/item/" + data.wishlist_id, data).then(function(response) { 52 return Promise.resolve(response.data.item); 53 }); 54 }, 55 getList: function() { 56 return axios.get("/c/account/wishlist/my-lists.php").then(function(response) { 57 return Promise.resolve(response.data); 58 }); 59 }, 60 search: function(data) { 61 let instance = this.getAxiosInstance(); 62 return instance.get("/api/wishlist/search", {params: data}).then(function(result) { 63 return Promise.resolve(result.data); 64 }); 65 }, 66 getCustomer: function(customerId) { 67 let instance = this.getAxiosInstance(); 68 return instance.get("/api/wishlist/customer-info/" + customerId).then(function(response) { 69 return Promise.resolve(response.data); 70 }); 71 }, 72};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.