✨ New edited at property to prevent post background update shows as edited
This commit is contained in:
parent
2366c3fd42
commit
16d1790fb1
@ -28,6 +28,7 @@ type Post struct {
|
|||||||
RepostTo *Post `json:"repost_to" gorm:"foreignKey:RepostID"`
|
RepostTo *Post `json:"repost_to" gorm:"foreignKey:RepostID"`
|
||||||
Realm *Realm `json:"realm"`
|
Realm *Realm `json:"realm"`
|
||||||
|
|
||||||
|
EditedAt *time.Time `json:"edited_at"`
|
||||||
PinnedAt *time.Time `json:"pinned_at"`
|
PinnedAt *time.Time `json:"pinned_at"`
|
||||||
|
|
||||||
IsDraft bool `json:"is_draft"`
|
IsDraft bool `json:"is_draft"`
|
||||||
|
@ -226,6 +226,8 @@ func NewPost(user models.Account, item models.Post) (models.Post, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item.EditedAt = lo.ToPtr(time.Now())
|
||||||
|
|
||||||
if err := database.C.Save(&item).Error; err != nil {
|
if err := database.C.Save(&item).Error; err != nil {
|
||||||
return item, err
|
return item, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user