From a7db1c528b7b0dae4ba65224fea6618b61d57bf4 Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 12 Aug 2019 11:54:13 +0100 Subject: [PATCH] making uploads safe --- lib/common/apifunctions/submit_receipt_api.dart | 3 ++- lib/pages/receipt_page_2.dart | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/common/apifunctions/submit_receipt_api.dart b/lib/common/apifunctions/submit_receipt_api.dart index 9dbb338..9093cbc 100644 --- a/lib/common/apifunctions/submit_receipt_api.dart +++ b/lib/common/apifunctions/submit_receipt_api.dart @@ -31,7 +31,8 @@ Future submitReceiptAPI( 'transaction_type' : "3", 'transaction_value': receipt.amount, 'purchase_time': receipt.time, - 'category': receipt.category, +// 'category': receipt.category, +// 'category': receipt.category, 'essential': receipt.essential, 'organisation_name': receipt.organisationName, 'recurring': receipt.recurring, diff --git a/lib/pages/receipt_page_2.dart b/lib/pages/receipt_page_2.dart index f23be12..67de152 100644 --- a/lib/pages/receipt_page_2.dart +++ b/lib/pages/receipt_page_2.dart @@ -59,11 +59,15 @@ class ReceiptPage2State extends State { receipt.postcode = transaction.organisation.postcode; receipt.town = transaction.organisation.town; receipt.recurring = transaction.recurring; + + if (transaction.recurring == "None") { + receipt.recurring = ""; + } + receipt.category = transaction.category; receipt.amount = transaction.amount.text.toString(); receipt.time = DateFormat("yyyy-MM-dd'T'hh:mm':00.000+01:00'").format(transaction.date).toString(); receipt.essential = transaction.isEssential.toString(); -// receipt.time = dt.format(transaction.date); submitReceiptAPI(context, receipt); }