updated the condition

This commit is contained in:
ArnabChatterjee20k
2025-05-21 13:29:24 +05:30
parent 8796670c66
commit 82fd8553bf
+1 -1
View File
@@ -1349,7 +1349,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
->inject('queueForEvents')
->inject('plan')
->action(function (string $databaseId, string $collectionId, string $key, ?int $size, ?bool $required, ?string $default, bool $array, bool $encrypt, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, array $plan) {
if ($encrypt && !empty($plan) && !isset($plan['databasesAllowEncrypt'])) {
if ($encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) {
throw new Exception(Exception::ATTRIBUTE_FORMAT_UNSUPPORTED, 'Encrypted string attributes are not available on your plan. Please upgrade to create encrypted string attributes.');
}
// Ensure attribute default is within required size