mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-12 22:14:26 +00:00
refactor(databases): streamline backup queries to use team context
- Updated backup retrieval logic in DatabasesController to utilize the new ownedByCurrentTeam method for improved access control. - Enhanced code readability and maintainability by centralizing team-based filtering in the ScheduledDatabaseBackup model.
This commit is contained in:
1 parent
5c6ab50332
commit
bb06a74fee
2 files changed
+9
-4
No files matched your search
@@ -10,6 +10,11 @@ class ScheduledDatabaseBackup extends BaseModel
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public static function ownedByCurrentTeam()
|
||||
{
|
||||
return ScheduledDatabaseBackup::whereRelation('team', 'id', currentTeam()->id)->orderBy('name');
|
||||
}
|
||||
|
||||
public function team()
|
||||
{
|
||||
return $this->belongsTo(Team::class);
|
||||
|
||||
Reference in new issue
Block a user