Skip to content

Commit

Permalink
fix: allow negative cd_ref
Browse files Browse the repository at this point in the history
- PR sur Taxhub associée : PnX-SI/TaxHub#368

Reviewed-by: andriacap
  • Loading branch information
andriacap committed Jul 16, 2024
1 parent fbe3ef7 commit f578278
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions atlas/atlasAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def searchCommuneAPI():

if not current_app.config["AFFICHAGE_MAILLE"]:

@api.route("/observationsMailleAndPoint/<int:cd_ref>", methods=["GET"])
@api.route("/observationsMailleAndPoint/<int(signed=True):cd_ref>", methods=["GET"])
def getObservationsMailleAndPointAPI(cd_ref):
"""
Retourne les observations d'un taxon en point et en maille
Expand All @@ -55,7 +55,7 @@ def getObservationsMailleAndPointAPI(cd_ref):
return jsonify(observations)


@api.route("/observationsMaille/<int:cd_ref>", methods=["GET"])
@api.route("/observationsMaille/<int(signed=True):cd_ref>", methods=["GET"])
def getObservationsMailleAPI(cd_ref):
"""
Retourne les observations d'un taxon par maille (et le nombre d'observation par maille)
Expand All @@ -75,15 +75,15 @@ def getObservationsMailleAPI(cd_ref):

if not current_app.config["AFFICHAGE_MAILLE"]:

@api.route("/observationsPoint/<int:cd_ref>", methods=["GET"])
@api.route("/observationsPoint/<int(signed=True):cd_ref>", methods=["GET"])
def getObservationsPointAPI(cd_ref):
session = db.session
observations = vmObservationsRepository.searchObservationsChilds(session, cd_ref)
session.close()
return jsonify(observations)


@api.route("/observations/<int:cd_ref>", methods=["GET"])
@api.route("/observations/<int(signed=True):cd_ref>", methods=["GET"])
def getObservationsGenericApi(cd_ref: int):
"""[summary]
Expand All @@ -110,7 +110,7 @@ def getObservationsGenericApi(cd_ref: int):

if not current_app.config["AFFICHAGE_MAILLE"]:

@api.route("/observations/<insee>/<int:cd_ref>", methods=["GET"])
@api.route("/observations/<insee>/<int(signed=True):cd_ref>", methods=["GET"])
def getObservationsCommuneTaxonAPI(insee, cd_ref):
connection = db.engine.connect()
observations = vmObservationsRepository.getObservationTaxonCommune(
Expand All @@ -120,7 +120,7 @@ def getObservationsCommuneTaxonAPI(insee, cd_ref):
return jsonify(observations)


@api.route("/observationsMaille/<insee>/<int:cd_ref>", methods=["GET"])
@api.route("/observationsMaille/<insee>/<int(signed=True):cd_ref>", methods=["GET"])
def getObservationsCommuneTaxonMailleAPI(insee, cd_ref):
connection = db.engine.connect()
observations = vmObservationsMaillesRepository.getObservationsTaxonCommuneMaille(
Expand Down

0 comments on commit f578278

Please sign in to comment.