Compare commits

..

2 Commits

Author SHA1 Message Date
18a68b452f Merge branch 'dev/post-reports' of git.anthrove.art:Anthrove/otter-space-sdk into dev/post-reports
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 2m57s
Gitea Build Check / Build (push) Successful in 2m58s
2024-11-06 12:22:27 +01:00
1ae76234b2 fix(database): update function 2024-11-06 12:20:24 +01:00

View File

@ -120,7 +120,7 @@ func UpdatePostReport(ctx context.Context, postReport models.PostReport) error {
ReportState: postReport.ReportState, ReportState: postReport.ReportState,
} }
result := client.WithContext(ctx).Model(&updatePost).Update("deleted_at", gorm.DeletedAt{}) result := client.WithContext(ctx).Model(&updatePost).Updates(updatePost)
if result.Error != nil { if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) { if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.NoDataFound}) return utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.NoDataFound})