fix(activitylog): add space even if resource got deleted

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-06-27 14:18:02 +02:00
parent b78910dea9
commit 43df861b67
3 changed files with 10 additions and 4 deletions
@@ -192,6 +192,11 @@ func WithSharee(uid *user.UserId, gid *group.GroupId) ActivityOption {
// WithSpace sets the space variable for an activity
func WithSpace(spaceid *provider.StorageSpaceId) ActivityOption {
return func(ctx context.Context, gwc gateway.GatewayAPIClient, vars map[string]interface{}) error {
if _, ok := vars["space"]; ok {
// do not override space if already set
return nil
}
s, err := utils.GetSpace(ctx, spaceid.GetOpaqueId(), gwc)
if err != nil {
vars["space"] = Resource{