diff --git a/feedgenerator.go b/feedgenerator.go index f7aa6f7..2b4fc18 100644 --- a/feedgenerator.go +++ b/feedgenerator.go @@ -12,7 +12,8 @@ import ( type feedStore interface { GetUsersFeed(usersDID string, cursor int64, limit int) ([]store.FeedPost, error) GetSubscriptionsForUser(ctx context.Context, userDID string) ([]store.Subscription, error) - DeleteSubscriptionByIdAndUser(userDID string, id int) error + DeleteSubscriptionBySubRKeyAndUser(userDID, rkey string) error + DeleteFeedPostsForSubscribedPostURIandUserDID(subscribedPostURI, userDID string) error } type FeedGenerator struct { @@ -66,6 +67,10 @@ func (f *FeedGenerator) GetSubscriptionsForUser(ctx context.Context, userDID str return f.store.GetSubscriptionsForUser(ctx, userDID) } -func (f *FeedGenerator) DeleteSubscriptionByIdAndUser(userDID string, id int) error { - return f.store.DeleteSubscriptionByIdAndUser(userDID, id) +func (f *FeedGenerator) DeleteSubscriptionBySubRKeyAndUser(userDID, rkey string) error { + return f.store.DeleteSubscriptionBySubRKeyAndUser(userDID, rkey) +} + +func (f *FeedGenerator) DeleteFeedPostsForSubscribedPostURIandUserDID(subscribedPostURI, userDID string) error { + return f.store.DeleteFeedPostsForSubscribedPostURIandUserDID(subscribedPostURI, userDID) } diff --git a/frontend/base.templ b/frontend/base.templ index 8c2ca1a..8b3b05d 100644 --- a/frontend/base.templ +++ b/frontend/base.templ @@ -4,7 +4,7 @@ templ Base() {
-") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -104,7 +104,7 @@ func Something(name, email string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -117,7 +117,7 @@ func Something(name, email string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -130,7 +130,7 @@ func Something(name, email string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -143,7 +143,7 @@ func Something(name, email string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -156,7 +156,7 @@ func Something(name, email string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -169,7 +169,7 @@ func Something(name, email string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Subscriptions
- // LOOP THROUGH THE TODOS -| + { sub.SubscribedPostURI } + | ++ + | +
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -52,30 +52,30 @@ func Subscriptions(errorMsg string, subscriptions []store.Subscription) templ.Co if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Subscriptions