Skip to content

Commit 07df4ef

Browse files
Diarmuidjessegeens
authored andcommitted
adding clarification that the link returned is empty and more of a shell reference to a link than a link itself
1 parent a3d0065 commit 07df4ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

share/sql/public_link.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (m *PublicShareMgr) CreatePublicShare(ctx context.Context, u *user.User, md
149149
}
150150

151151
func (m *PublicShareMgr) UpdatePublicShare(ctx context.Context, u *user.User, req *link.UpdatePublicShareRequest, g *link.Grant) (*link.PublicShare, error) {
152-
publiclink, err := m.getPublicLink(ctx, req.Ref)
152+
publiclink, err := m.getEmptyPublicLink(ctx, req.Ref)
153153
if err != nil {
154154
return nil, err
155155
}
@@ -215,7 +215,7 @@ func (m *PublicShareMgr) UpdatePublicShare(ctx context.Context, u *user.User, re
215215
}
216216

217217
func (m *PublicShareMgr) MarkAsOrphaned(ctx context.Context, ref *link.PublicShareReference) error {
218-
publicLink, err := m.getPublicLink(ctx, ref)
218+
publicLink, err := m.getEmptyPublicLink(ctx, ref)
219219
if err != nil {
220220
return err
221221
}
@@ -389,7 +389,7 @@ func (m *PublicShareMgr) GetPublicLink(ctx context.Context, ref *link.PublicShar
389389
}
390390

391391
// Performs similarly to GetPublicLink but instead attempts to reduce the number of DB calls by creating a empty link containing only ID
392-
func (m *PublicShareMgr) getPublicLink(ctx context.Context, ref *link.PublicShareReference) (*model.PublicLink, error) {
392+
func (m *PublicShareMgr) getEmptyPublicLink(ctx context.Context, ref *link.PublicShareReference) (*model.PublicLink, error) {
393393
var publiclink *model.PublicLink
394394
var err error
395395
if id := ref.GetId(); id != nil {

0 commit comments

Comments
 (0)