aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/db/articles.sql.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/db/articles.sql.go')
-rw-r--r--backend/db/articles.sql.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/backend/db/articles.sql.go b/backend/db/articles.sql.go
index 7492598..bf6ea1d 100644
--- a/backend/db/articles.sql.go
+++ b/backend/db/articles.sql.go
@@ -184,7 +184,7 @@ SELECT
f.id as feed_id_2, f.url as feed_url, f.title as feed_title, f.is_subscribed as feed_is_subscribed
FROM articles AS a
INNER JOIN feeds AS f ON a.feed_id = f.id
-WHERE a.is_read = 1 AND f.is_subscribed = 1
+WHERE a.is_read = 1 AND f.is_subscribed = 1 AND f.user_id = ?
ORDER BY a.id DESC
LIMIT 100
`
@@ -202,8 +202,8 @@ type GetReadArticlesRow struct {
FeedIsSubscribed int64
}
-func (q *Queries) GetReadArticles(ctx context.Context) ([]GetReadArticlesRow, error) {
- rows, err := q.db.QueryContext(ctx, getReadArticles)
+func (q *Queries) GetReadArticles(ctx context.Context, userID int64) ([]GetReadArticlesRow, error) {
+ rows, err := q.db.QueryContext(ctx, getReadArticles, userID)
if err != nil {
return nil, err
}
@@ -242,7 +242,7 @@ SELECT
f.id as feed_id_2, f.url as feed_url, f.title as feed_title, f.is_subscribed as feed_is_subscribed
FROM articles AS a
INNER JOIN feeds AS f ON a.feed_id = f.id
-WHERE a.is_read = 0 AND f.is_subscribed = 1
+WHERE a.is_read = 0 AND f.is_subscribed = 1 AND f.user_id = ?
ORDER BY a.id DESC
LIMIT 100
`
@@ -260,8 +260,8 @@ type GetUnreadArticlesRow struct {
FeedIsSubscribed int64
}
-func (q *Queries) GetUnreadArticles(ctx context.Context) ([]GetUnreadArticlesRow, error) {
- rows, err := q.db.QueryContext(ctx, getUnreadArticles)
+func (q *Queries) GetUnreadArticles(ctx context.Context, userID int64) ([]GetUnreadArticlesRow, error) {
+ rows, err := q.db.QueryContext(ctx, getUnreadArticles, userID)
if err != nil {
return nil, err
}