add rybbit
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from aws_lambda_powertools import Logger
|
||||
from aws_lambda_powertools.event_handler.api_gateway import Router
|
||||
from aws_lambda_powertools.event_handler.exceptions import NotFoundError
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair, PartitionKey
|
||||
|
||||
from boto3clients import dynamodb_client
|
||||
from config import ENROLLMENT_TABLE
|
||||
@@ -11,6 +11,14 @@ router = Router()
|
||||
dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
|
||||
|
||||
|
||||
@router.get('/<org_id>/enrollments/submissions')
|
||||
def submissions(org_id: str):
|
||||
return dyn.collection.query(
|
||||
PartitionKey(f'SUBMISSION#ORG#{org_id}'),
|
||||
projection_expr='id, sk, created_by',
|
||||
)
|
||||
|
||||
|
||||
@router.get('/<org_id>/enrollments/<submission_id>/submitted')
|
||||
def submitted(org_id: str, submission_id: str):
|
||||
return dyn.collection.get_item(
|
||||
|
||||
Reference in New Issue
Block a user