forked from enviPath/enviPy
Implement basic group listing and re-enabled group creation
This commit is contained in:
23
epapi/v1/endpoints/groups.py
Normal file
23
epapi/v1/endpoints/groups.py
Normal file
@ -0,0 +1,23 @@
|
||||
from django.conf import settings as s
|
||||
from ninja import Router
|
||||
from ninja_extra.pagination import paginate
|
||||
|
||||
from epdb.logic import GroupManager
|
||||
|
||||
from ..pagination import EnhancedPageNumberPagination
|
||||
from ..schemas import GroupOutSchema
|
||||
|
||||
router = Router()
|
||||
|
||||
|
||||
@router.get("/groups/", response=EnhancedPageNumberPagination.Output[GroupOutSchema])
|
||||
@paginate(
|
||||
EnhancedPageNumberPagination,
|
||||
page_size=s.API_PAGINATION_DEFAULT_PAGE_SIZE,
|
||||
)
|
||||
def list_all_groups(request):
|
||||
"""
|
||||
List all groups the user has access to.
|
||||
"""
|
||||
user = request.user
|
||||
return GroupManager.get_groups(user)
|
||||
@ -15,9 +15,9 @@ router = Router()
|
||||
EnhancedPageNumberPagination,
|
||||
page_size=s.API_PAGINATION_DEFAULT_PAGE_SIZE,
|
||||
)
|
||||
def list_all_pathways(request):
|
||||
def list_all_settings(request):
|
||||
"""
|
||||
List all pathways from reviewed packages.
|
||||
List all settings the user has access to.
|
||||
"""
|
||||
user = request.user
|
||||
return SettingManager.get_all_settings(user)
|
||||
|
||||
Reference in New Issue
Block a user