Skip to content

Commit ae0ad34

Browse files
committed
converted gene_query endpoint from POST to GET
1 parent e94514d commit ae0ad34

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎api/resources/gene_information.py‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,17 @@ def get(self, species="", chromosome="", start_param="", end_param=""):
265265

266266
@gene_information.route("/gene_query")
267267
class GeneQueryGene(Resource):
268-
@gene_information.expect(query_genes_request_fields)
269-
def post(self):
268+
@gene_information.param("species", _in="query", default="arabidopsis")
269+
@gene_information.param("terms", _in="query", default="AT1G01010,AT1G01020")
270+
def get(self):
270271
"""This end point provides gene information for multiple genes given multiple terms."""
271272

272-
# Escape input
273-
data = request.get_json()
274-
species = data["species"]
275-
terms = [term.upper() for term in data["terms"]]
273+
species = escape(request.args.get("species", ""))
274+
terms_raw = request.args.get("terms", "")
275+
terms = [t.strip().upper() for t in terms_raw.split(",") if t.strip()]
276+
277+
if not species or not terms:
278+
return BARUtils.error_exit("Missing species or terms"), 400
276279

277280
# Species check
278281
if species == "arabidopsis":

0 commit comments

Comments
 (0)