Included preview for new campaign

This commit is contained in:
2019-05-11 16:17:19 +08:00
parent 8071c7d1c0
commit d606cc129b
8 changed files with 60 additions and 26 deletions

View File

@@ -158,7 +158,7 @@ func (tapit *Tapit) createCampaign(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Bad request", 400)
return
}
if newCampaignJson.Name != "" {
if newCampaignJson.Name != "" && newCampaignJson.FromNumber != "" && newCampaignJson.PhonebookId != 0 && newCampaignJson.TextTemplateId != 0 {
var newCampaign Campaign
// populate details to be used later
@@ -226,7 +226,7 @@ func (tapit *Tapit) createCampaign(w http.ResponseWriter, r *http.Request) {
notifyPopup(w, r, "success", "Successfully added new campaign", newCampaignJson)
return
} else {
notifyPopup(w, r, "failure", "Please enter the campaign name", nil)
notifyPopup(w, r, "failure", "Please enter campaign details", nil)
return
}
}