Skip to content

Commit

Permalink
remove old response field
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Dec 17, 2024
1 parent e2b8c7c commit e1ca459
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions pkg/handlers/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,9 @@ func (h *Handler) ListInstanceBackups(w http.ResponseWriter, r *http.Request) {
}

type GetBackupResponse struct {
BackupDetails []snapshottypes.BackupDetail `json:"backupDetails"`
Deprecated_BackupDetail *snapshottypes.BackupDetail `json:"backupDetail"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
BackupDetails []snapshottypes.BackupDetail `json:"backupDetails"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}

func (h *Handler) GetBackup(w http.ResponseWriter, r *http.Request) {
Expand All @@ -148,10 +147,6 @@ func (h *Handler) GetBackup(w http.ResponseWriter, r *http.Request) {
}
getBackupResponse.BackupDetails = backups

if len(backups) == 1 {
getBackupResponse.Deprecated_BackupDetail = &backups[0]
}

getBackupResponse.Success = true

JSON(w, http.StatusOK, getBackupResponse)
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/RestoreSnapshotRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RestoreSnapshotRow extends Component {
if (result.success) {
this.setState({
isLoadingBackupInfo: false,
backupInfo: result.backupDetail,
backupInfo: result.backupDetails?.[0],
backupInfoMsg: "",
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/snapshots/SnapshotDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class SnapshotDetails extends Component {
}
const response = await res.json();

const snapshotDetails = response.backupDetail;
const snapshotDetails = response.backupDetails?.[0];

let series = [];
if (!isEmpty(snapshotDetails?.volumes)) {
Expand Down

0 comments on commit e1ca459

Please sign in to comment.