refactor: changed to swarmBountyId Based
This commit is contained in:
@ -9,14 +9,14 @@ logger = logging.getLogger(__name__)
|
||||
bp = Blueprint("submission", __name__)
|
||||
|
||||
|
||||
@bp.get("/submission/<roundNumber>")
|
||||
def fetch_submission(roundNumber):
|
||||
logger.info(f"Fetching submission for round: {roundNumber}")
|
||||
@bp.get("/submission/<swarmBountyId>")
|
||||
def fetch_submission(swarmBountyId):
|
||||
logger.info(f"Fetching submission for swarmBountyId: {swarmBountyId}")
|
||||
db = get_db()
|
||||
submission = (
|
||||
db.query(Submission)
|
||||
.filter(
|
||||
Submission.round_number == int(roundNumber),
|
||||
Submission.swarmBountyId == int(swarmBountyId),
|
||||
)
|
||||
.first()
|
||||
)
|
||||
@ -28,7 +28,7 @@ def fetch_submission(roundNumber):
|
||||
return jsonify(
|
||||
{
|
||||
"taskId": submission.task_id,
|
||||
"roundNumber": submission.round_number,
|
||||
"swarmBountyId": submission.swarmBountyId,
|
||||
"status": submission.status,
|
||||
"prUrl": submission.pr_url,
|
||||
"githubUsername": github_username,
|
||||
|
Reference in New Issue
Block a user