We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ [SyntaxError: JSON Parse error: Unrecognized token '<'] line: 10658, column: 14, sourceURL: 'http://11.0.8.2:8081/index.bundle?platform=android&dev=true&minify=false' }
url: http://www.recipepuppy.com/recipes/findByIngredients//?ingredients=bacon%2C%20cucumber%2C%20banana&fillIngredients=false&limitLicense=false&number=20&ranking=1 giving me 404 page not found
The text was updated successfully, but these errors were encountered:
@rahulbhankar786, that's because the api path and param names have changed. Make the following changes to api.js and recipes.js actions:
api.js
recipes.js
api.js:
static xhr(route, params, verb) { const host = 'http://www.recipepuppy.com/api' const url = `${host}${route}` let options = Object.assign({ method: verb }, params ? { body: JSON.stringify(params) } : null ); options.headers = Api.headers() return fetch(url, options).then( resp => { let json = resp.json(); if (resp.ok) { return json } return json.then(err => {throw err}); }).then( json => json.results ); }
recipes.js actions:
export function fetchRecipes(ingredients) { return (dispatch, getState) => { const params = [ `i=${encodeURIComponent(ingredients)}`, ].join('&'); return Api.get(`/?${params}`) .then(resp => { console.log(resp); }) .catch(err => { console.log(err); }) }; }
Sorry, something went wrong.
No branches or pull requests
{ [SyntaxError: JSON Parse error: Unrecognized token '<']
line: 10658,
column: 14,
sourceURL: 'http://11.0.8.2:8081/index.bundle?platform=android&dev=true&minify=false' }
url: http://www.recipepuppy.com/recipes/findByIngredients//?ingredients=bacon%2C%20cucumber%2C%20banana&fillIngredients=false&limitLicense=false&number=20&ranking=1 giving me 404 page not found
The text was updated successfully, but these errors were encountered: