Skip to content

Commit 6ccf52b

Browse files
FIX (backups): Fix downloading file from S3
1 parent 2523a69 commit 6ccf52b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

backend/internal/features/backups/backups/service.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,12 @@ func (s *BackupService) GetBackupFile(
332332
return nil, errors.New("user does not have access to this backup")
333333
}
334334

335-
return backup.Storage.GetFile(backup.ID)
335+
storage, err := s.storageService.GetStorageByID(backup.StorageID)
336+
if err != nil {
337+
return nil, err
338+
}
339+
340+
return storage.GetFile(backup.ID)
336341
}
337342

338343
func (s *BackupService) deleteBackup(backup *Backup) error {

frontend/src/features/backups/ui/BackupsComponent.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export const BackupsComponent = ({ database }: Props) => {
282282
return (
283283
<div className="flex gap-2 text-lg">
284284
{record.status === BackupStatus.COMPLETED && (
285-
<div>
285+
<div className="flex gap-2">
286286
{deletingBackupId === record.id ? (
287287
<SyncOutlined spin />
288288
) : (
@@ -298,7 +298,7 @@ export const BackupsComponent = ({ database }: Props) => {
298298
/>
299299
</Tooltip>
300300

301-
<Tooltip className="ml-3" title="Restore from backup">
301+
<Tooltip title="Restore from backup">
302302
<CloudUploadOutlined
303303
className="cursor-pointer"
304304
onClick={() => {
@@ -310,12 +310,9 @@ export const BackupsComponent = ({ database }: Props) => {
310310
/>
311311
</Tooltip>
312312

313-
<Tooltip
314-
className="ml-3"
315-
title="Download backup file. It can be restored manually via pg_restore (from custom format)"
316-
>
313+
<Tooltip title="Download backup file. It can be restored manually via pg_restore (from custom format)">
317314
{downloadingBackupId === record.id ? (
318-
<SyncOutlined spin />
315+
<SyncOutlined spin style={{ color: '#0d6efd' }} />
319316
) : (
320317
<DownloadOutlined
321318
className="cursor-pointer"

0 commit comments

Comments
 (0)