mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Fix exception with endpoints returning HTTP status code 204. Fixes #1891
This commit is contained in:
1 parent
36b9f8bdfd
commit
ce55ec73a4
29 files changed
+337
-192
No files matched your search
@@ -23,7 +23,7 @@ import logging
|
||||
|
||||
log = logging.getLogger()
|
||||
|
||||
from fastapi import APIRouter, Depends, status
|
||||
from fastapi import APIRouter, Depends, Response, status
|
||||
from typing import List
|
||||
from uuid import UUID
|
||||
|
||||
@@ -69,12 +69,13 @@ def get_snapshots(project: Project = Depends(dep_project)) -> List[schemas.Snaps
|
||||
|
||||
|
||||
@router.delete("/{snapshot_id}", status_code=status.HTTP_204_NO_CONTENT)
|
||||
async def delete_snapshot(snapshot_id: UUID, project: Project = Depends(dep_project)) -> None:
|
||||
async def delete_snapshot(snapshot_id: UUID, project: Project = Depends(dep_project)) -> Response:
|
||||
"""
|
||||
Delete a snapshot.
|
||||
"""
|
||||
|
||||
await project.delete_snapshot(str(snapshot_id))
|
||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
@router.post("/{snapshot_id}/restore", status_code=status.HTTP_201_CREATED, response_model=schemas.Project)
|
||||
|
||||
Reference in new issue
Block a user