Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow negative cd_ref #564

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading