Skip to content

Commit

Permalink
Exclude deleted user when querying database
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbaranov committed Aug 11, 2024
1 parent 03f15ae commit 371e93f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/db/queries/bot_user/get_all_bot_users_for_chat.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SELECT id, name, is_premium, deleted, banned, moderator
FROM bot_user
INNER JOIN chat_member cm ON bot_user.id = cm.bot_user_id
WHERE chat_id = @chatId;
WHERE chat_id = @chatId
AND deleted = false;
3 changes: 2 additions & 1 deletion assets/db/queries/bot_user/get_single_user_for_chat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ SELECT id, name, is_premium, deleted, banned, moderator
FROM bot_user
INNER JOIN chat_member cm ON bot_user.id = cm.bot_user_id
WHERE chat_id = @chatId
AND bot_user.id = @userId;
AND bot_user.id = @userId
AND deleted = false;

0 comments on commit 371e93f

Please sign in to comment.