def subscribe(topic_id): """Adds user to subscription table.""" userId = user_interface.getUserId()[0] subscriptionInterface.addSubscription(str(userId), str(topic_id)) flash("You are now subscribed") return redirect(url_for('show_topicPosts', topic_id=topic_id))
def down_vote(topic_id, post_id, username): userId = user_interface.getUserId()[0] print("downvote") VotesInterface.callDownVote(str(userId), str(post_id)) ##return render_template(url_for('show_post', topic_id=topic_id, post_id=post_id)) return redirect(url_for('show_post', post_id=post_id, topic_id=topic_id))
def notifications(): """Gets all notifications for a user to be rendered.""" userId = user_interface.getUserId()[0] notifications = notificationInterface.getNotifications(str(userId)) return render_template('notifications.html', notifications=notifications)