#9 - feed follows

This commit is contained in:
2025-03-11 14:53:10 +02:00
parent ed8b8860b7
commit b7b7a7d55d
12 changed files with 324 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ import (
"time"
)
func AddFeedHandler(s *config.State, cmd config.Command) error {
func AddFeedHandler(s *config.State, cmd config.Command, user database.User) error {
if len(cmd.Args) < 2 {
log.Fatal("usage: boot-dev-blog-aggregator addfeed NAME URL")
@@ -45,6 +45,17 @@ func AddFeedHandler(s *config.State, cmd config.Command) error {
return err
}
_, err = s.DB.CreateFeedFollow(ctx, database.CreateFeedFollowParams{
ID: uuid.New(),
CreatedAt: time.Time{},
UpdatedAt: time.Time{},
UserID: user.ID,
FeedID: f.ID,
})
if err != nil {
return err
}
fmt.Printf("%v", f)
return nil