
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
강의 4-7 보고 했는데 . 연결은 됬는데 db 저장이 안되요
@app.route("/wines", methods=["POST"])
def web_wines_post():
star_receive = request.form['star_give']
commend_receive = request.form['commend_give']
doc = {
'star':star_receive,
'commend':commend_receive
}
db.wines.insert_one(doc)
return jsonify({'msg': 'POST 연결 완료!'})
function save_order() {
let star = $('star').val()
let comment = $('comment').val()
$.ajax({
type: 'POST',
url: '/wines',
data: {star_give: star, comment_give: comment},
success: function (response) {
alert(response['msg'])
window.location.reload()
}
});
}
