From 104341ddc4add57f83c58cb3fabb23b6fbfdd3e4 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sun, 2 Nov 2025 00:00:35 +0900
Subject: wip

---
 backend/db/queries/articles.sql | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'backend/db/queries/articles.sql')

diff --git a/backend/db/queries/articles.sql b/backend/db/queries/articles.sql
index c1feaae..b910fcf 100644
--- a/backend/db/queries/articles.sql
+++ b/backend/db/queries/articles.sql
@@ -4,7 +4,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.id = ?;
+WHERE a.id = ? AND f.user_id = ?;
 
 -- name: GetUnreadArticles :many
 SELECT
@@ -12,7 +12,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;
 
@@ -22,7 +22,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;
 
-- 
cgit v1.2.3-70-g09d2

