From d5719e934a22c895b6cc24f5fee7624fa8075af2 Mon Sep 17 00:00:00 2001 From: rawleyIfowler Date: Fri, 25 Feb 2022 21:49:38 -0600 Subject: [PATCH] fixed infinite comment length --- models/comment.go | 4 ++-- templates/blog_post.tmpl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/comment.go b/models/comment.go index 8234c87..8a07bdc 100644 --- a/models/comment.go +++ b/models/comment.go @@ -24,7 +24,7 @@ type Comment struct { gorm.Model Id uint `json:"id" gorm:"primaryKey, AUTO_INCREMENT"` Date string `json:"date" gorm:"default:NOW()"` - Author string `json:"author" form:"author"` - Content string `json:"content" form:"content"` + Author string `json:"author" form:"author" gorm:"type:varchar(50)"` + Content string `json:"content" form:"content" gorm:"type:varchar(500)"` AssociatedPost string } diff --git a/templates/blog_post.tmpl b/templates/blog_post.tmpl index 5ab7ec5..53c0624 100644 --- a/templates/blog_post.tmpl +++ b/templates/blog_post.tmpl @@ -17,8 +17,8 @@ {{ end }}

Leave a comment!

- - + +