Skip to content

Commit

Permalink
Fix duplicate entry handling and send Flex message
Browse files Browse the repository at this point in the history
  • Loading branch information
kkdai committed Jan 25, 2024
1 parent 2270ff5 commit 0c9bf3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ func callbackHandler(w http.ResponseWriter, r *http.Request) {
dbUser, err := nDB.QueryDatabaseByEmail(person.Email)
if err == nil && len(dbUser) > 0 {
log.Println("Already exist in DB", dbUser)
if err := replyText(e.ReplyToken, "已經存在於資料庫中,請勿重複輸入"+"\n"+jsonData); err != nil {
if err := SendFlexMsg(e.ReplyToken, dbUser); err != nil {
log.Println("Error send result", err)
}
if err = replyText(e.ReplyToken, "已經存在於資料庫中,請勿重複輸入"); err != nil {
log.Print(err)
}
continue
Expand Down

0 comments on commit 0c9bf3a

Please sign in to comment.