Refactor storage file retrieval to use queries directly for counting, improving consistency in authorization handling. Update Action class to remove unnecessary authorization skip, and include authorization in Email/Create class constructor for better dependency management.

This commit is contained in:
shimon
2025-11-02 21:24:11 +02:00
parent dbccb16784
commit c13aed651a
3 changed files with 6 additions and 7 deletions
@@ -614,7 +614,7 @@ abstract class Action extends UtopiaAction
}
} else {
try {
$authorization->skip(fn () => $dbForProject->updateAttribute(
$dbForProject->updateAttribute(
collection: $collectionId,
id: $key,
size: $size,
@@ -622,7 +622,7 @@ abstract class Action extends UtopiaAction
default: $default,
formatOptions: $options,
newKey: $newKey ?? null
));
);
} catch (DuplicateException) {
throw new Exception($this->getDuplicateException());
} catch (IndexException $e) {
@@ -91,7 +91,8 @@ class Create extends Action
$response,
$dbForProject,
$queueForDatabase,
$queueForEvents
$queueForEvents,
$authorization
);
$response