From 915fa4501000c3a1237452c7935cd4506fdeceac Mon Sep 17 00:00:00 2001 From: violetaperezandrade Date: Tue, 30 Apr 2024 17:54:23 -0300 Subject: [PATCH] address PR comment: -fix delete endpoint response --- app/controller/measurements.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controller/measurements.py b/app/controller/measurements.py index 94ea350..daea70f 100644 --- a/app/controller/measurements.py +++ b/app/controller/measurements.py @@ -1,5 +1,6 @@ from fastapi import status from fastapi.responses import JSONResponse +from fastapi.encoders import jsonable_encoder from service.measurements import MeasurementsService from service.plants import PlantsService from schemas.measurement import MeasurementSavedSchema @@ -72,7 +73,9 @@ def handle_delete_device_plant_relation(self, type_id, id): if response: return JSONResponse( status_code=status.HTTP_200_OK, - content=response + content=jsonable_encoder({ + "message": "Device plant relation deleted successfully.", + }), ) return JSONResponse( status_code=status.HTTP_204_NO_CONTENT,