added new membership tests, fix tests, cors for dev
This commit is contained in:
@@ -33,18 +33,18 @@ func (cc *ContactController) RelayContactRequest(c *gin.Context) {
|
||||
validate := validator.New()
|
||||
if err := validate.Struct(msgData); err != nil {
|
||||
logger.Error.Printf("Couldn't validate contact form data: %#v: %v", msgData, err)
|
||||
c.HTML(http.StatusOK, "contactForm_reply.html", gin.H{"Error": "Form submission failed. Please try again."})
|
||||
c.HTML(http.StatusNotAcceptable, "contactForm_reply.html", gin.H{"Error": "Form validation failed. Please check again."})
|
||||
// c.JSON(http.StatusNotAcceptable, gin.H{"error": "Couldn't validate contact form data"})
|
||||
return
|
||||
}
|
||||
|
||||
if err := cc.EmailService.RelayContactFormMessage(msgData.Email, msgData.Name, msgData.Message); err != nil {
|
||||
logger.Error.Printf("Couldn't send contact message mail: %v", err)
|
||||
c.HTML(http.StatusOK, "contactForm_reply.html", gin.H{"Error": "Form submission failed. Please try again."})
|
||||
c.HTML(http.StatusInternalServerError, "contactForm_reply.html", gin.H{"Error": "Email submission failed. Please try again."})
|
||||
// c.JSON(http.StatusInternalServerError, gin.H{"error": "Couldn't send mail"})
|
||||
return
|
||||
}
|
||||
|
||||
// c.JSON(http.StatusAccepted, "Your message has been sent")
|
||||
c.HTML(http.StatusOK, "contactForm_reply.html", gin.H{"Success": true})
|
||||
c.HTML(http.StatusAccepted, "contactForm_reply.html", gin.H{"Success": true})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user