Skip to content

Commit

Permalink
fix: api call
Browse files Browse the repository at this point in the history
  • Loading branch information
MSchmoecker committed Aug 16, 2024
1 parent 1fc0274 commit dedd032
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 2 additions & 3 deletions controller/thymis_controller/routers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ async def build_download_image(


@router.post("/action/restart-device")
def deploy(
async def restart_device(
identifier: str,
background_tasks: BackgroundTasks,
project: project.Project = Depends(get_project),
):
background_tasks.add_task(project.create_restart_device_task(identifier))
await project.create_restart_device_task(identifier)


@router.get("/download-image")
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/routes/devices/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@
}
function restartDevice(device: Device) {
fetch(
`${controllerProtocol}://${controllerHost}/action/restart-device?identifier=${device.identifier}`,
{
method: 'POST'
}
);
fetch(`/api/action/restart-device?identifier=${device.identifier}`, { method: 'POST' });
}
const downloadUri = (uri: string) => {
Expand Down

0 comments on commit dedd032

Please sign in to comment.