Move DB queries related to 'users' in a separate module (2/2)

This commit is contained in:
Samantaz Fox
2021-12-03 03:29:52 +01:00
parent 094f835642
commit 7691f53520
10 changed files with 121 additions and 43 deletions

View File

@@ -137,7 +137,7 @@ module Invidious::Routes::Embed
# end
if notifications && notifications.includes? id
PG_DB.exec("UPDATE users SET notifications = array_remove(notifications, $1) WHERE email = $2", id, user.as(User).email)
Invidious::Database::Users.remove_notification(user.as(User), id)
env.get("user").as(User).notifications.delete(id)
notifications.delete(id)
end