Skip to content

Commit

Permalink
Merge pull request #423 from cho4036/user
Browse files Browse the repository at this point in the history
minor fix. change user deletion from hard to soft
  • Loading branch information
ktkfree authored Apr 24, 2024
2 parents aca8a1e + 68913cf commit 49ec92d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
)

type User struct {
gorm.Model

ID uuid.UUID `gorm:"primarykey;type:uuid" json:"id"`
AccountId string `json:"accountId"`
Password string `gorm:"-:all" json:"password"`
Expand Down
2 changes: 1 addition & 1 deletion internal/repository/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (r *UserRepository) DeleteWithUuid(ctx context.Context, uuid uuid.UUID) err
return err
}

res := r.db.WithContext(ctx).Unscoped().Delete(&user)
res := r.db.WithContext(ctx).Delete(&user)
if res.Error != nil {
log.Errorf(ctx, "error is :%s(%T)", res.Error.Error(), res.Error)
return res.Error
Expand Down

0 comments on commit 49ec92d

Please sign in to comment.