Skip to content

Commit

Permalink
Default to current generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
anybodys committed Jun 1, 2024
1 parent 1696955 commit faf8b4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion votingapi/voting/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from flask import Flask, jsonify, request

from voting.storage import art_storage
from voting.storage import art_storage, db


def create_app():
Expand All @@ -19,6 +19,8 @@ def health_check():
@app.get("/art")
def art():
gen = request.args.get('gen', -1)
if gen < 0:
gen = db.get_current_generation()

# Return a list of all the requested generation's art metadata.
return jsonify(art_storage.ArtStorage().get_art(gen))
3 changes: 3 additions & 0 deletions votingapi/voting/storage/db.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def get_current_generation():
# TODO: Look up current gen in the db.
return 0

0 comments on commit faf8b4d

Please sign in to comment.