fix delete ur own feedz bug
Jes Olson j3s@c3f.net
Sun, 19 Mar 2023 06:51:44 -0700
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
site.go
→
site.go
@@ -212,7 +212,6 @@ }
// TODO: validate user input moar feeds := strings.Split(inputData, "\r\n") - s.db.UnsubscribeAll(s.username(r)) for _, feed := range feeds { // TODO: show diff before submission (like tf plan) // TODO: check if feed exists in db already?@@ -231,6 +230,10 @@ http.Error(w, "400 bad request: "+err.Error(), 400)
fmt.Println(err) return } + } + + s.db.UnsubscribeAll(s.username(r)) + for _, feed := range feeds { s.db.WriteFeed(feed) s.db.Subscribe(s.username(r), feed) }