Add folder to WithResource function
Signed-off-by: Christian Richter <crichter@owncloud.com> Co-authored-by: Julian Koberg <jkoberg@owncloud.com> Co-authored-by: Victor Scharf <vscharf@owncloud.com>
This commit is contained in:
co-authored by
Julian Koberg
Victor Scharf
parent
b852303353
commit
1213a734cb
@@ -69,6 +69,16 @@ func WithResource(ref *provider.Reference, addSpace bool) ActivityOption {
|
||||
Name: info.GetName(),
|
||||
}
|
||||
|
||||
parent, err := utils.GetResourceByID(ctx, info.GetParentId(), gwc)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
vars["folder"] = Resource{
|
||||
ID: info.GetParentId().GetOpaqueId(),
|
||||
Name: parent.GetName(),
|
||||
}
|
||||
|
||||
if addSpace {
|
||||
vars["space"] = Resource{
|
||||
ID: info.GetSpace().GetId().GetOpaqueId(),
|
||||
|
||||
Reference in New Issue
Block a user