Skip to content
New issue

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

Liking comments #8

Open
tsainez opened this issue Dec 10, 2021 · 0 comments
Open

Liking comments #8

tsainez opened this issue Dec 10, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tsainez
Copy link
Owner

tsainez commented Dec 10, 2021

Users should be allowed to like or unlike comments.

In dens.py you might want to change get_likes() to something like...

# Returns the number of likes by post_id
def get_likes(id, type):
    if type == 'post':
        likes = get_db().execute('''
        SELECT COUNT(*) AS COUNT
        FROM post_like_assoc
        WHERE post_id = ?;
        ''', (id,)).fetchone()
        return likes['count']
    elif type == 'comment':
        # ... return the likes for a specific comment ...

as well as update every time get_likes is called elsewhere...

@tsainez tsainez added enhancement New feature or request help wanted Extra attention is needed labels Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants