add user to org
This commit is contained in:
17
api.saladeaula.digital/app/routes/orgs/admins.py
Normal file
17
api.saladeaula.digital/app/routes/orgs/admins.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from aws_lambda_powertools.event_handler.api_gateway import Router
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||
|
||||
from boto3clients import dynamodb_client
|
||||
from config import COURSE_TABLE, USER_TABLE
|
||||
|
||||
router = Router()
|
||||
dyn = DynamoDBPersistenceLayer(USER_TABLE, dynamodb_client)
|
||||
|
||||
|
||||
@router.get('/<org_id>/admins')
|
||||
def get_admins(org_id: str):
|
||||
return dyn.collection.query(
|
||||
KeyPair(org_id, 'admins#'),
|
||||
table_name=COURSE_TABLE,
|
||||
limit=100,
|
||||
)
|
||||
Reference in New Issue
Block a user