diff options
Diffstat (limited to 'add.go')
| -rw-r--r-- | add.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -3,6 +3,7 @@ package main import ( "bytes" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -42,6 +43,13 @@ type options struct { func addCard(c *http.Client, front, back string) tea.Cmd { return func() tea.Msg { + if back == "" { + return errMsg(errors.New("definition is blank")) + } + if front == "" { + return errMsg(errors.New("word is blank")) + } + noteRequest := addNote{ Action: "addNote", Version: apiVersion, |
