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

Switch MMW Front-End to Use Geoprocessing API for Mapshed, GWLF-E #3475

Closed
2 of 4 tasks
rajadain opened this issue Feb 2, 2022 · 1 comment
Closed
2 of 4 tasks

Switch MMW Front-End to Use Geoprocessing API for Mapshed, GWLF-E #3475

rajadain opened this issue Feb 2, 2022 · 1 comment
Assignees
Labels
DRWI Funding Source: Delaware River Watershed Initiative

Comments

@rajadain
Copy link
Member

rajadain commented Feb 2, 2022

Once #3472 and #3473 are in:

  • Switch the front-end to use the new public endpoints
  • Ensure that the modeling works correctly for anonymous and logged in users
  • Remove the old internal endpoints
  • Update any tests (consider moving them to the geoprocessing_api app if needed)
@rajadain rajadain mentioned this issue Feb 2, 2022
37 tasks
@rajadain rajadain added the DRWI Funding Source: Delaware River Watershed Initiative label Feb 2, 2022
@rajadain rajadain self-assigned this Mar 17, 2022
@rajadain
Copy link
Member Author

Need to move these endpoints to the public API under subbasin as well:

@decorators.api_view(['GET'])
@decorators.permission_classes((AllowAny, ))
def subbasins_detail(request):
mapshed_job_uuid = request.query_params.get('mapshed_job_uuid')
mapshed_job = Job.objects.get(uuid=mapshed_job_uuid)
gmss = json.loads(mapshed_job.result)
if gmss:
huc12s = get_huc12s(gmss.keys())
return Response(huc12s)
else:
return Response(status=status.HTTP_404_NOT_FOUND)
@decorators.api_view(['GET'])
@decorators.permission_classes((AllowAny, ))
def subbasin_catchments_detail(request):
encoded_comids = request.query_params.get('catchment_comids')
catchment_comids = json.loads(unquote(encoded_comids))
if catchment_comids and len(catchment_comids) > 0:
catchments = get_catchments(catchment_comids)
return Response(catchments)
else:
return Response(status=status.HTTP_404_NOT_FOUND)

and to switch the front-end to use the new APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRWI Funding Source: Delaware River Watershed Initiative
Projects
None yet
Development

No branches or pull requests

1 participant