Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Aug 18, 2024
1 parent ea25a3b commit b557762
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/posts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,15 @@ defmodule Bonfire.Posts do

# TODO: should we only delete the PostContent and the activity? so as to preserve thread and nesting integrity

object = repo().maybe_preload(object, [:media])
delete_media = e(object, :media, [])

opts
|> Keyword.update(
:delete_media,
delete_media,
&Enum.uniq(List.wrap(&1) ++ delete_media)
)
|> Keyword.put(
:delete_associations,
# adds per-type assocs
Expand Down

0 comments on commit b557762

Please sign in to comment.