diff options
Diffstat (limited to 'internal/client/tui/submit.go')
| -rw-r--r-- | internal/client/tui/submit.go | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/internal/client/tui/submit.go b/internal/client/tui/submit.go index 15b7826..5507000 100644 --- a/internal/client/tui/submit.go +++ b/internal/client/tui/submit.go @@ -3,30 +3,25 @@ package tui import ( "fmt" + "codeberg.org/snonux/gos/internal/config/client" config "codeberg.org/snonux/gos/internal/config/client" tea "github.com/charmbracelet/bubbletea" ) func submitAction(conf config.ClientConfig) tea.Cmd { - // The composed file is now the file to be submitted. - //submitFile := fmt.Sprintf("%s/%s", conf.DataDir, conf.ComposeFile) + composeFile := fmt.Sprintf("%s/%s", conf.DataDir, conf.ComposeFile) - /* - c := &http.Client{ - Timeout: 10 * time.Second, - } - res, err := c.Get(url) - if err != nil { - return sub{err} - } - defer res.Body.Close() - */ + return submitMessage(conf, composeFile, func() error { + // This is the callback to call + return nil + }) +} +func submitMessage(conf client.ClientConfig, filePath string, callback func() error) tea.Cmd { return func() tea.Msg { - err := fmt.Errorf("this is a test errorrrrrr!") return finishedMsg{ - err: err, + callback: callback, + err: fmt.Errorf("This is a sample error"), } } - } |
