fetchProducts() {
		if(this.state.imageBlob == undefined){
			console.err("Image Blob must be set.");
		}
		let filename = 'upload.jpg';
		let img = this.state.imageBlob;
		request({
			url: '/api/search/image/WomenShoes/1/12/',
			method: 'POST',
			data: { filename: filename, file: img },
		}).then((res) => {
			console.log(res);
			if (res.result !== undefined){
				this.setState({
					resultsReceived: true,
					searching: false,
					productList: res.result
				});
				mixpanel.track(
				"Searched Images",
					{"Result Set": res.result}
				);
			} else {
				this.setState({
					searching: false
				});
			}
		});
		this.setState({
			searching: true,
			resultsReceived: false
		});
	}
/*
	* Connects to Visenze and fetches the products that compare to the image that was sent. 
	* PARAMS: 
		imageURI - Image to upload to ViSenze for comparison.
		start - Index of results to start searching from.
		limit - the limit to results you want.
	* MANIPULATES STATES:
		resultsReceived - Default is false, after results are received or changed it becomes true.
		productList - The list of products that are returned by the ViSenze API.
	*/
Connects to Visenze and fetches the products that compare to the image that was sent.
PARAMS:
imageURI - Image to upload to ViSenze for comparison.
start - Index of results to start searching from.
limit - the limit to results you want.
MANIPULATES STATES:
resultsReceived - Default is false, after results are received or changed it becomes true.
productList - The list of products that are returned by the ViSenze API.
Connects to Visenze and fetches the products that compare to the image that was sent . PARAMS : imageURI - Image to upload to ViSenze for comparison . start - Index of results to start searching from . limit - the limit to results you want . MANIPULATES STATES : resultsReceived - Default is false after results are received or changed it becomes true . productList - The list of products that are returned by the ViSenze API .
fetchProducts() {
		if(this.state.imageBlob == undefined){
			console.err("Image Blob must be set.");
		}
		let filename = 'upload.jpg';
		let img = this.state.imageBlob;
		request({
			url: '/api/search/image/WomenShoes/1/12/',
			method: 'POST',
			data: { filename: filename, file: img },
		}).then((res) => {
			console.log(res);
			if (res.result !== undefined){
				this.setState({
					resultsReceived: true,
					searching: false,
					productList: res.result
				});
				mixpanel.track(
				"Searched Images",
					{"Result Set": res.result}
				);
			} else {
				this.setState({
					searching: false
				});
			}
		});
		this.setState({
			searching: true,
			resultsReceived: false
		});
	}
fetchProducts ( ) { if ( this . state . imageBlob == undefined ) { console . err ( "Image Blob must be set." ) ; } let filename = 'upload.jpg' ; let img = this . state . imageBlob ; request ( { url : '/api/search/image/WomenShoes/1/12/' , method : 'POST' , data : { filename : filename , file : img } , } ) . then ( ( res ) => { console . log ( res ) ; if ( res . result !== undefined ) { this . setState ( { resultsReceived : true , searching : false , productList : res . result } ) ; mixpanel . track ( "Searched Images" , { "Result Set" : res . result } ) ; } else { this . setState ( { searching : false } ) ; } } ) ; this . setState ( { searching : true , resultsReceived : false } ) ; }
Connects to Visenze and fetches the products that compare to the image that was sent.
Connects to Visenze and fetches the products that compare to the image that was sent .