def welcome(): token = request.cookies.get('token') if token: user = UserService.get_user_info(token) else: user = {} return render_template('welcome.html', user=user)
def notes(): token = request.cookies.get('token') if token: user = UserService.get_user_info(token) uid = user['uid'] note_list = UserService.get_notes(uid) note_list_update = UserService.update_Abbreviation(note_list) return render_template('notes.html', note_list=note_list_update)
def createnote(): if request.method == 'POST': title = request.form['title'] content = request.form['content'] token = request.cookies.get('token') if token: user = UserService.get_user_info(token) uid = user['uid'] UserService.createnote(uid, title, content) resp = make_response(redirect('/', '302')) return resp elif request.method == 'GET': return render_template('note.html')