Skip to content

Commit

Permalink
Add missing cases to all managers
Browse files Browse the repository at this point in the history
Co-authored-by: Jörn Dreyer <jfd@butonic.de>
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>

Signed-off-by: Christian Richter <crichter@owncloud.com>
  • Loading branch information
dragonchaser committed Sep 22, 2023
1 parent 538f297 commit 7816400
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (h *Handler) updateReceivedShare(w http.ResponseWriter, r *http.Request, sh
return nil
}

hideFlag, _ := strconv.ParseBool(r.URL.Query().Get("hide"))
hideFlag, err := strconv.ParseBool(r.URL.Query().Get("hide"))

Check failure on line 154 in internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to err (ineffassign)

// we need to add a path to the share
shareRequest := &collaboration.UpdateReceivedShareRequest{
Expand Down
2 changes: 2 additions & 0 deletions pkg/share/manager/cs3/cs3.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ func (m *Manager) UpdateReceivedShare(ctx context.Context, rshare *collaboration
rs.State = rshare.State
case "mount_point":
rs.MountPoint = rshare.MountPoint
case "hide":
continue
default:
return nil, errtypes.NotSupported("updating " + fieldMask.Paths[i] + " is not supported")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/share/manager/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func (m *mgr) UpdateShare(ctx context.Context, ref *collaboration.ShareReference
case "expiration":
m.model.Shares[idx].Expiration = updated.Expiration
case "hide":
m.model.Shares[idx].Hide = updated.Hide
continue
default:
return nil, errtypes.NotSupported("updating " + fieldMask.Paths[i] + " is not supported")
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/share/manager/jsoncs3/jsoncs3.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,8 @@ func (m *Manager) UpdateReceivedShare(ctx context.Context, receivedShare *collab
return nil, err
}

log.Error().Interface("receivedShare", receivedShare).Interface("rs", rs).Msg("=================> Shares")

for i := range fieldMask.Paths {
switch fieldMask.Paths[i] {
case "state":
Expand Down
2 changes: 2 additions & 0 deletions pkg/share/manager/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ func (m *manager) UpdateReceivedShare(ctx context.Context, receivedShare *collab
rs.State = receivedShare.State
case "mount_point":
rs.MountPoint = receivedShare.MountPoint
case "hide":
continue
default:
return nil, errtypes.NotSupported("updating " + fieldMask.Paths[i] + " is not supported")
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/share/manager/owncloudsql/owncloudsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ func (m *mgr) UpdateReceivedShare(ctx context.Context, receivedShare *collaborat
fields = append(fields, "file_target=?")
rs.MountPoint = receivedShare.MountPoint
params = append(params, rs.MountPoint.Path)
case "hide":
continue
default:
return nil, errtypes.NotSupported("updating " + fieldMask.Paths[i] + " is not supported")
}
Expand Down

0 comments on commit 7816400

Please sign in to comment.