From 227d8f79e17ea7e94f766dfe3f14d2a9282da8d0 Mon Sep 17 00:00:00 2001 From: Andy Shultz Date: Wed, 25 Oct 2023 14:34:58 -0400 Subject: [PATCH] feat: return debug-useful response from endpoint --- flashcards/apps/api/v1/views.py | 2 +- flashcards/apps/cards/anki.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flashcards/apps/api/v1/views.py b/flashcards/apps/api/v1/views.py index 17de3da..563b833 100644 --- a/flashcards/apps/api/v1/views.py +++ b/flashcards/apps/api/v1/views.py @@ -9,4 +9,4 @@ @require_http_methods(['GET']) def cards(request, course_id, block_id): cards = anki_from_block_id(course_id, block_id) - return Response("cards") + return Response(cards) diff --git a/flashcards/apps/cards/anki.py b/flashcards/apps/cards/anki.py index 6bc28b6..771da19 100644 --- a/flashcards/apps/cards/anki.py +++ b/flashcards/apps/cards/anki.py @@ -45,4 +45,5 @@ def anki_from_block_id(course_id, block_id): csv_maybe = cards_from_block_id(course_id, block_id) result = csv_maybe.replace('\t', '') create_anki_cards(result) + return csv_maybe # return the CSV text so we can see it in testing