Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 2 additions & 29 deletions lib/Service/AanbodService.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,24 +336,11 @@ public function acceptAanbod(string $aanbodId, array $options = []): array
$selfData['organisation'] = $currentOrg;
$aanbodData['@self'] = $selfData;

// Get schema and register from object
$schemaId = $aanbodData['@self']['schema'] ?? null;
$registerId = $aanbodData['@self']['register'] ?? null;

if (!$schemaId || !$registerId) {
return [
'success' => false,
'error' => 'Aanbod object missing schema or register information',
'aanbod' => null
];
}

// Save the updated object with RBAC and multitenancy disabled
// ObjectService should be able to determine register and schema from the object itself
$existingAanbod->setObject($aanbodData);
$updatedAanbod = $objectService->saveObject(
object: $existingAanbod,
register: $registerId,
schema: $schemaId,
uuid: $aanbodId,
rbac: false,
multi: false
Expand Down Expand Up @@ -505,22 +492,8 @@ public function denyAanbod(string $aanbodId, array $options = []): array
];
}

// Get schema and register from object
$schemaId = $aanbodData['@self']['schema'] ?? null;
$registerId = $aanbodData['@self']['register'] ?? null;

if (!$schemaId || !$registerId) {
return [
'success' => false,
'error' => 'Aanbod object missing schema or register information',
'deleted' => false
];
}

// Delete the object with RBAC and multitenancy disabled
$objectService->setRegister($registerId);
$objectService->setSchema($schemaId);

// ObjectService should be able to determine register and schema from the UUID
$deleteResult = $objectService->deleteObject(
uuid: $aanbodId,
rbac: false,
Expand Down