#9 - feed follows
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user