From ee2cb360bfb6ab35cb8a373fd1237993cea168d0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 18 Oct 2024 21:36:54 +0300 Subject: initial work on editing a post --- internal/platforms/mastodon/mastodon.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'internal/platforms/mastodon/mastodon.go') diff --git a/internal/platforms/mastodon/mastodon.go b/internal/platforms/mastodon/mastodon.go index 390de4c..d4f9e7b 100644 --- a/internal/platforms/mastodon/mastodon.go +++ b/internal/platforms/mastodon/mastodon.go @@ -27,16 +27,9 @@ func Post(ctx context.Context, args config.Args, sizeLimit int, ent entry.Entry) log.Println("Not posting", ent, "to Mastodon as dry-run enabled") return nil } - switch prompt.DoYouWantThis("Do you want to post this message to Mastodon?", content) { - case prompt.No: - return prompt.ErrAborted - case prompt.Yes: - case prompt.Edit: - panic("edit not yet implemented") // TODO - default: - panic("should never happen") + if err := prompt.DoYouWantThis("Do you want to post this message to Mastodon?", content); err != nil { + return err } - req, err := http.NewRequestWithContext(ctx, "POST", args.Secrets.MastodonURL, bytes.NewBuffer(payloadBytes)) if err != nil { return fmt.Errorf("failed to create request: %w", err) -- cgit v1.2.3