-
- def get_tombstone(%Activity{data: data}, deleted \\ DateTime.utc_now()) do
- %{
- id: data["id"],
- context: data["context"],
- type: "tombstone",
- published: data["published"],
- deleted: deleted
- }
- end
-
- def swap_data_with_tombstone(activity) do
- tombstone = get_tombstone(activity)
-
- activity
- |> change(%{data: tombstone})
- |> Repo.update()
- end