Skip to content

Commit

Permalink
Resolving more comments on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Geens committed Jan 13, 2025
1 parent 5391b34 commit 48683cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 0 additions & 2 deletions share/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ type ProtoShare struct {
ItemType ItemType // file | folder | reference | symlink
InitialPath string
Inode string
FileSource int64
FileTarget string
Permissions uint8
Instance string
Orphan bool
Expand Down
16 changes: 15 additions & 1 deletion share/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,21 @@ func (m *mgr) GetShare(ctx context.Context, ref *collaboration.ShareReference) (
}

func (m *mgr) Unshare(ctx context.Context, ref *collaboration.ShareReference) error {
share, err := m.getShare(ctx, ref)
var share *model.Share
var err error
if id := ref.GetId(); id != nil {
var intId int
intId, err = strconv.Atoi(id.OpaqueId)
share = &model.Share{
ProtoShare: model.ProtoShare{
Model: gorm.Model{
ID: uint(intId),
},
},
}
} else {
share, err = m.getShare(ctx, ref)
}
if err != nil {
return err
}
Expand Down

0 comments on commit 48683cf

Please sign in to comment.