I am building simple Flask web-app using Google books API. I am a beginner and maybe overthinking details, but something tells me I haven't designed this very well.
Problem I am facing:
- Find book through search bar
- Button on each search result to post review page: review/book/<book_id> - POST request
- Actual page where you write review and submit: summary/add/<book_id> - POST request
What I find strange is that I have POST request following another POST request, just because I couldn't find a way how to send <book_id> over to the write review page. There is also problem redirecting user back since this page is @login_required but there is no GET request on it.
So my main question is: Is there a way to send <book_id> over without making the initial post request (from search result to post review page)? Maybe with javascript?
Thank you
If I understood correctly, you have to send <book_id> in a GET request ?
If yes, you can do something on following lines
I had defined the blueprints for my application. But it's okay even if you don't have that. You can use simply
@app.route
, or the one which you have for other POST apis.