mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-03 07:12:33 +00:00
refactor(databases): update backup queries to use team-specific method
- Modified backup retrieval logic in DatabasesController to utilize the new ownedByCurrentTeamAPI method for improved access control based on team ID. - Enhanced code consistency and maintainability by centralizing team-based filtering in the ScheduledDatabaseBackup model.
This commit is contained in:
1 parent
bb06a74fee
commit
33d25f418e
2 files changed
+11
-6
No files matched your search
@@ -15,6 +15,11 @@ class ScheduledDatabaseBackup extends BaseModel
|
||||
return ScheduledDatabaseBackup::whereRelation('team', 'id', currentTeam()->id)->orderBy('name');
|
||||
}
|
||||
|
||||
public static function ownedByCurrentTeamAPI(int $teamId)
|
||||
{
|
||||
return ScheduledDatabaseBackup::whereRelation('team', 'id', $teamId)->orderBy('name');
|
||||
}
|
||||
|
||||
public function team()
|
||||
{
|
||||
return $this->belongsTo(Team::class);
|
||||
|
||||
Reference in new issue
Block a user