This commit is contained in:
Eric Meehan 2025-10-13 13:10:15 -04:00
parent f1b3eab3a3
commit 20931ba41f
2 changed files with 4 additions and 2 deletions

View File

@ -246,8 +246,8 @@ class Database():
cur.execute(self.SQL_GET_LAST_BLOCK) cur.execute(self.SQL_GET_LAST_BLOCK)
blocks = cur.fetchall() blocks = cur.fetchall()
if blocks: if blocks:
blockCard = self.get_card_by_block_id(lastBlock[0]) blockCard = self.get_card_by_block_id(blocks[0])
blockTransactions = self.get_transactions_by_block_id(lastBlock[0]) blockTransactions = self.get_transactions_by_block_id(blocks[0])
return [ return [
Block( Block(
blockId = uuid.UUID(block[0]), blockId = uuid.UUID(block[0]),

View File

@ -171,6 +171,8 @@ def cards_get():
) )
) )
return flask.jsonify([card.as_dict() for card in deck] if deck else []) return flask.jsonify([card.as_dict() for card in deck] if deck else [])
else:
return flask.jsonify({'Error': "No public key."}), 400
except Exception as e: except Exception as e:
return flask.jsonify( return flask.jsonify(
{'Error': str(e)} {'Error': str(e)}