🐛 Bug fixes of edit comment
✨ Comments now supports attachment!
This commit is contained in:
parent
82a6c6dd31
commit
1181b1e5ce
@ -7,6 +7,7 @@ type Comment struct {
|
|||||||
Hashtags []Tag `json:"tags" gorm:"many2many:comment_tags"`
|
Hashtags []Tag `json:"tags" gorm:"many2many:comment_tags"`
|
||||||
Categories []Category `json:"categories" gorm:"many2many:comment_categories"`
|
Categories []Category `json:"categories" gorm:"many2many:comment_categories"`
|
||||||
Reactions []Reaction `json:"reactions"`
|
Reactions []Reaction `json:"reactions"`
|
||||||
|
Attachments []Attachment `json:"attachments"`
|
||||||
ReplyID *uint `json:"reply_id"`
|
ReplyID *uint `json:"reply_id"`
|
||||||
ReplyTo *Comment `json:"reply_to" gorm:"foreignKey:ReplyID"`
|
ReplyTo *Comment `json:"reply_to" gorm:"foreignKey:ReplyID"`
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ func createComment(c *fiber.Ctx) error {
|
|||||||
PublishedAt *time.Time `json:"published_at" form:"published_at"`
|
PublishedAt *time.Time `json:"published_at" form:"published_at"`
|
||||||
Hashtags []models.Tag `json:"hashtags" form:"hashtags"`
|
Hashtags []models.Tag `json:"hashtags" form:"hashtags"`
|
||||||
Categories []models.Category `json:"categories" form:"categories"`
|
Categories []models.Category `json:"categories" form:"categories"`
|
||||||
|
Attachments []models.Attachment `json:"attachments" form:"attachments"`
|
||||||
ReplyTo uint `json:"reply_to" form:"reply_to"`
|
ReplyTo uint `json:"reply_to" form:"reply_to"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ func createComment(c *fiber.Ctx) error {
|
|||||||
},
|
},
|
||||||
Hashtags: data.Hashtags,
|
Hashtags: data.Hashtags,
|
||||||
Categories: data.Categories,
|
Categories: data.Categories,
|
||||||
|
Attachments: data.Attachments,
|
||||||
Content: data.Content,
|
Content: data.Content,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ func editMoment(c *fiber.Ctx) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var item *models.Moment
|
var item *models.Comment
|
||||||
if err := database.C.Where(models.Comment{
|
if err := database.C.Where(models.Comment{
|
||||||
PostBase: models.PostBase{
|
PostBase: models.PostBase{
|
||||||
BaseModel: models.BaseModel{ID: uint(id)},
|
BaseModel: models.BaseModel{ID: uint(id)},
|
||||||
|
Loading…
Reference in New Issue
Block a user