fixed bug where you could comment on non existant blog posts

This commit is contained in:
rawleyIfowler
2022-03-02 13:56:36 -06:00
parent 22811c8b0a
commit 0ffe1cf33d
2 changed files with 7 additions and 2 deletions

View File

@@ -28,3 +28,7 @@ type BlogPost struct {
Content string `json:"content"`
Comments []Comment `gorm:"foreignKey:AssociatedPost;references:Url;type:varchar(191)"`
}
func (b BlogPost) Equals(m *BlogPost) bool {
return b.Url == m.Url
}