From 91e1af6402295939f4139d9b217c8fd1b098c7d3 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 29 Jul 2024 20:44:38 -0400 Subject: [PATCH] Fix gallery deletion --- lib/philomena/galleries.ex | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/philomena/galleries.ex b/lib/philomena/galleries.ex index c553ad3e..65516064 100644 --- a/lib/philomena/galleries.ex +++ b/lib/philomena/galleries.ex @@ -15,7 +15,6 @@ defmodule Philomena.Galleries do alias Philomena.GalleryReorderWorker alias Philomena.Notifications alias Philomena.NotificationWorker - alias Philomena.Notifications.{Notification, UnreadNotification} alias Philomena.Images use Philomena.Subscriptions, @@ -95,21 +94,8 @@ defmodule Philomena.Galleries do |> select([i], i.image_id) |> Repo.all() - unread_notifications = - UnreadNotification - |> join(:inner, [un], _ in assoc(un, :notification)) - |> where([_, n], n.actor_type == "Gallery") - |> where([_, n], n.actor_id == ^gallery.id) - - notifications = - Notification - |> where(actor_type: "Gallery") - |> where(actor_id: ^gallery.id) - Multi.new() |> Multi.delete(:gallery, gallery) - |> Multi.delete_all(:unread_notifications, unread_notifications) - |> Multi.delete_all(:notifications, notifications) |> Repo.transaction() |> case do {:ok, %{gallery: gallery}} ->