Skip to content

Commit

Permalink
Merge pull request #69 from lead-ifal/feature/corrigir-listagem-sensores
Browse files Browse the repository at this point in the history
Feature/corrigir listagem sensores
  • Loading branch information
lopesmayk authored Sep 12, 2022
2 parents 7e3a83d + 4e111ae commit 99b7498
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/sensor_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def create():
except:
return GlobalController.generate_response(HTTP_BAD_REQUEST_CODE, ERROR_MESSAGE)

def list():
sensors_list = sensors.find()
def list(user_id):
sensors_zone_list = sensors_zones.find({ 'user_id' : user_id })
data = []

for sensor in sensors_list:
Expand All @@ -52,7 +52,7 @@ def list():
}
data.append(json.dumps(dictionary))

print(data)

return GlobalController.generate_response(HTTP_SUCCESS_CODE, SUCCESS_MESSAGE, data)

@has_token
Expand Down Expand Up @@ -84,4 +84,4 @@ def handle_messages(client, userdata, message):
sensor_reading_data
)

raise Exception()
raise Exception()

0 comments on commit 99b7498

Please sign in to comment.