mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-18 06:14:15 +00:00
feat(storages): add method to retrieve the first storage ID for improved stability in storage display
This commit is contained in:
1 parent
5e0b86f322
commit
13af4811f5
2 files changed
+13
-2
No files matched your search
@@ -9,4 +9,15 @@ class All extends Component
|
||||
public $resource;
|
||||
|
||||
protected $listeners = ['refreshStorages' => '$refresh'];
|
||||
|
||||
public function getFirstStorageIdProperty()
|
||||
{
|
||||
if ($this->resource->persistentStorages->isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Use the storage with the smallest ID as the "first" one
|
||||
// This ensures stability even when storages are deleted
|
||||
return $this->resource->persistentStorages->sortBy('id')->first()->id;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user