Skip to content

Commit

Permalink
Merge pull request #67 from TheJacksonLaboratory/G3-245-gs-threshold-…
Browse files Browse the repository at this point in the history
…endpoint-return-code

G3-245 genset threshold update endpoint return code
  • Loading branch information
francastell authored May 16, 2024
2 parents 745049e + 6e54864 commit dfccdf7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "geneweaver-api"
version = "0.6.0a1"
version = "0.6.0a2"
description = "The Geneweaver API"
authors = [
"Alexander Berger <[email protected]>",
Expand Down
6 changes: 2 additions & 4 deletions src/geneweaver/api/controller/genesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ def get_publication_for_geneset(
return pub_resp


@router.put("/{geneset_id}/threshold")
@router.put("/{geneset_id}/threshold", status_code=204)
def put_geneset_threshold(
geneset_id: Annotated[
int, Path(format="int64", minimum=0, maxiumum=9223372036854775807)
],
gene_score_type: GenesetScoreType,
user: UserInternal = Security(deps.full_user),
cursor: Optional[deps.Cursor] = Depends(deps.cursor),
) -> dict:
) -> None:
"""Set geneset threshold for geneset owner."""
response = genset_service.update_geneset_threshold(
cursor, geneset_id, gene_score_type, user
Expand All @@ -286,5 +286,3 @@ def put_geneset_threshold(
if "error" in response:
if response.get("message") == api_message.ACCESS_FORBIDDEN:
raise HTTPException(status_code=403, detail=api_message.ACCESS_FORBIDDEN)

return response
3 changes: 1 addition & 2 deletions tests/controllers/test_genesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ def test_set_geneset_endpoint_response(mock_update_geneset_threshold, client):
response = client.put(
"/api/genesets/1234/threshold", data=json.dumps(geneset_threshold_update_req)
)
assert response.status_code == 200
assert response.json() == {}
assert response.status_code == 204


@patch("geneweaver.api.services.geneset.update_geneset_threshold")
Expand Down

0 comments on commit dfccdf7

Please sign in to comment.