initial
This commit is contained in:
18
backend/routes/download_jobs.py
Normal file
18
backend/routes/download_jobs.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from flask import Blueprint, jsonify
|
||||
from backend.models import DownloadJob
|
||||
|
||||
bp = Blueprint('download_jobs', __name__, url_prefix='/api/download-jobs')
|
||||
|
||||
|
||||
@bp.route('/<int:job_id>', methods=['GET'])
|
||||
def get_job_status(job_id):
|
||||
"""Get download job status"""
|
||||
job = DownloadJob.query.get_or_404(job_id)
|
||||
return jsonify(job.to_dict()), 200
|
||||
|
||||
|
||||
@bp.route('/question/<int:question_id>', methods=['GET'])
|
||||
def get_job_by_question(question_id):
|
||||
"""Get download job for a question"""
|
||||
job = DownloadJob.query.filter_by(question_id=question_id).first_or_404()
|
||||
return jsonify(job.to_dict()), 200
|
||||
Reference in New Issue
Block a user