Skip to content

Commit

Permalink
add seperate endpoints for list of cartons and program nested under …
Browse files Browse the repository at this point in the history
…query
  • Loading branch information
imedan committed Dec 5, 2023
1 parent 1568101 commit d3ce33b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions python/valis/routes/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,19 @@ async def cone_search(self,
""" Perform a cone search """
return list(cone_search(ra, dec, radius, units=units))

@router.get('/carton_program_all', summary='Return a list of all carton or programs',
@router.get('/list/cartons', summary='Return a list of all cartons',
response_model=list, dependencies=[Depends(get_pw_db)])
async def carton_program_all(self,
name_type: str = Query('carton', enum=['carton', 'program'],
description='Specify search on carton or program', example='carton')):
async def cartons(self,
name_type: str = Query('carton', enum=['carton'],
description='Specify search on carton or program', example='carton')):
""" Return a list of all carton or programs """
return carton_program_list(name_type)

@router.get('/list/programs', summary='Return a list of all programs',
response_model=list, dependencies=[Depends(get_pw_db)])
async def programs(self,
name_type: str = Query('program', enum=['program'],
description='Specify search on carton or program', example='program')):
""" Return a list of all carton or programs """
return carton_program_list(name_type)

Expand Down

0 comments on commit d3ce33b

Please sign in to comment.