Skip to content

Commit

Permalink
restore rollbackSnapshot
Browse files Browse the repository at this point in the history
fizes #2026
  • Loading branch information
Steve-Mcl committed Apr 24, 2023
1 parent aeaec64 commit ca3cbf1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion frontend/src/api/instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,18 @@ const getInstanceDevices = async (instanceId, cursor, limit) => {
const getInstanceDeviceSettings = async (instanceId) => {
return client.get(`/api/v1/projects/${instanceId}/devices/settings`).then(res => res.data)
}

const updateInstanceDeviceSettings = async (instanceId, settings) => {
return client.post(`/api/v1/projects/${instanceId}/devices/settings`, settings).then(res => res.data)
}

const rollbackInstance = async (projectId, snapshotId) => {
const data = {
snapshot: snapshotId
}
return client.post(`/api/v1/projects/${projectId}/actions/rollback`, data).then(res => res.data)
}

export default {
create,
getInstance,
Expand All @@ -145,5 +153,6 @@ export default {
importInstance,
getInstanceDevices,
getInstanceDeviceSettings,
updateInstanceDeviceSettings
updateInstanceDeviceSettings,
rollbackInstance
}
2 changes: 1 addition & 1 deletion frontend/src/api/projectSnapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const create = async (projectId, options) => {
}

const rollbackSnapshot = async (projectId, snapshotId) => {
return instanceApi.rollbackProject(projectId, snapshotId)
return instanceApi.rollbackInstance(projectId, snapshotId)
}

/**
Expand Down

0 comments on commit ca3cbf1

Please sign in to comment.