diff --git a/api1.py b/api1.py index 81c3365..e0858e3 100644 --- a/api1.py +++ b/api1.py @@ -96,7 +96,7 @@ if __name__ == '__main__': if theRow is None: return jsonify({'success':False, 'error':f"No entry found for topic _{topic}_"}) - return jsonify({'success':True, 'topic':topic, 'active':theRow[0], 'expiry':theRow[1].strftime("%Y-%m-%d %H:%M:%S"), 'lastSeen':theRow[5].strftime("%Y-%m-%d %H:%M:%S"),'isExpired':theRow[4],'email':theRow[2], 'isNotified':theRow[3]}) + return jsonify({'success':True, 'topic':topic, 'active':bool(theRow[0]), 'expiry':theRow[1].strftime("%Y-%m-%d %H:%M:%S"), 'lastSeen':theRow[5].strftime("%Y-%m-%d %H:%M:%S"),'isExpired':bool(theRow[4]),'email':theRow[2], 'isNotified':bool(theRow[3])}) @app.route('/api/v1', methods=['PUT','POST']) def api_setRecord():