Skip to content

Commit

Permalink
feat: Implement read, create & delete operation on drone table
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradip-p committed Jul 29, 2024
1 parent 6f50087 commit 2bd16ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/backend/app/drones/drone_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,6 @@ async def create_drone(db: Database, drone_info: drone_schemas.DroneIn):

except Exception as e:
log.exception(e)
raise HTTPException(e) from e
raise HTTPException(
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Drone creation failed"
) from e
9 changes: 3 additions & 6 deletions src/backend/app/drones/drone_schemas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic import BaseModel


class DroneBase(BaseModel):
class DroneIn(BaseModel):
model: str
manufacturer: str
camera_model: str
Expand All @@ -16,9 +16,6 @@ class DroneBase(BaseModel):
weight: float


class DroneIn(DroneBase):
pass


class DroneOut(DroneBase):
class DroneOut(BaseModel):
id: int
model: str

0 comments on commit 2bd16ca

Please sign in to comment.