From 9ec3127da543dd624ffe7f96e624b0c5e07bb052 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 29 Jun 2022 12:00:41 +0900 Subject: [PATCH] Updated post deletion --- patches/post-parents/post-parents.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/patches/post-parents/post-parents.go b/patches/post-parents/post-parents.go index f9587140..45ae12c2 100644 --- a/patches/post-parents/post-parents.go +++ b/patches/post-parents/post-parents.go @@ -18,7 +18,15 @@ func main() { if obj == nil { color.Yellow(post.ID) color.Red(post.Text) - post.Delete() + + // Remove activities + for activity := range arn.StreamActivityCreates() { + if activity.ObjectID == post.ID && activity.ObjectType == "Post" { + activity.Delete() + } + } + + arn.DB.Delete("Post", post.ID) } } }