From add081f5de9a755fea324675804d6783b1def855 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 29 Jun 2020 18:25:31 +0200 Subject: Add traces endpoint --- web-server/opendc/api/v2/traces/endpoint.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'web-server/opendc/api/v2/traces/endpoint.py') diff --git a/web-server/opendc/api/v2/traces/endpoint.py b/web-server/opendc/api/v2/traces/endpoint.py index 58cc6153..720c6a1e 100644 --- a/web-server/opendc/api/v2/traces/endpoint.py +++ b/web-server/opendc/api/v2/traces/endpoint.py @@ -1,14 +1,10 @@ -from opendc.models_old.trace import Trace +from opendc.models.trace import Trace from opendc.util.rest import Response def GET(request): """Get all available Traces.""" - # Get the Traces + traces = Trace.get_all() - traces = Trace.query() - - # Return the Traces - - return Response(200, 'Successfully retrieved Traces', [x.to_JSON() for x in traces]) + return Response(200, 'Successfully retrieved Traces', traces.obj) -- cgit v1.2.3