From 70f3e2e29d10a2ef1f12a467cec5489fbb609fb7 Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:44:08 +0800 Subject: [PATCH] Fix pointer errors --- model/stories.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/stories.go b/model/stories.go index 19f513a..1f1dea6 100644 --- a/model/stories.go +++ b/model/stories.go @@ -118,8 +118,8 @@ func (s *Story) delete(tx *gorm.DB, storyID uint) *gorm.DB { return tx. Preload(clause.Associations). Where("id = ?", storyID). - First(&s). // store the value to be returned - Delete(&s) + First(s). // store the value to be returned + Delete(s) } func DeleteStory(db *gorm.DB, storyID int) (Story, error) {