mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Fix attribute update refactor collision
This commit is contained in:
parent
c88f1ed7ca
commit
82cb491a3c
1 changed files with 5 additions and 5 deletions
|
|
@ -614,14 +614,14 @@ abstract class Action extends UtopiaAction
|
|||
*/
|
||||
foreach ($collection->getAttribute('indexes') as $index) {
|
||||
/**
|
||||
* @var string[] $attribute
|
||||
* @var array<string> $attributes
|
||||
*/
|
||||
$attribute = $index->getAttribute('attributes', []);
|
||||
$found = \array_search($key, $attribute);
|
||||
$attributes = $index->getAttribute('attributes', []);
|
||||
$found = \array_search($key, $attributes);
|
||||
|
||||
if ($found !== false) {
|
||||
$attribute[$found] = $newKey;
|
||||
$index->setAttribute('attributes', $attribute);
|
||||
$attributes[$found] = $newKey;
|
||||
$index->setAttribute('attributes', $attributes);
|
||||
$dbForProject->updateDocument('indexes', $index->getId(), $index);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue