Updated web template handling of no template

This commit is contained in:
2019-07-08 11:12:34 +08:00
parent b518ba4ca6
commit 20d3045ce3
7 changed files with 15 additions and 6 deletions

View File

@@ -206,13 +206,17 @@ func (tapit *Tapit) createCampaign(w http.ResponseWriter, r *http.Request) {
for _, record := range newRecords {
var newJob Job
newJob.CurrentStatus = "Not Started"
newJob.WebStatus = "Not Visited"
newJob.ProviderTag = newCampaign.ProviderTag
newJob.AccSID = newAccSID
newJob.AuthToken = newAuthToken
newJob.FromNum = newCampaign.FromNumber
newJob.WebRoute = tapit.generateWebTemplateRoute()
newJob.FullUrl = tapit.globalSettings.WebTemplatePrefix + newJob.WebRoute
// handle web template only if given
if newCampaign.WebTemplateId != 0 {
newJob.WebStatus = "Not Visited"
newJob.WebRoute = tapit.generateWebTemplateRoute()
newJob.FullUrl = tapit.globalSettings.WebTemplatePrefix + newJob.WebRoute
}
// interpreting records
var newBodyText string

Binary file not shown.

View File

@@ -422,7 +422,7 @@ func (tapit *Tapit) webTemplateRouteHandler(w http.ResponseWriter, r *http.Reque
newVisit.BodyContent = string(requestBody)
rawReqBytes, err := httputil.DumpRequest(r, true)
if err == nil {
newVisit.RawRequest = string(rawReqBytes)
newVisit.RawRequest = string(rawReqBytes) + string(requestBody)
}
// Update visited status