update id

This commit is contained in:
2025-10-30 02:02:23 -03:00
parent f284b64c60
commit 76dfc44b71
25 changed files with 103 additions and 40 deletions

View File

@@ -1,7 +1,6 @@
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, SortKey, TransactKey
from boto3clients import dynamodb_client
from config import ENROLLMENT_TABLE
@@ -20,7 +19,6 @@ dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
@router.get('/<enrollment_id>')
def get_enrollment(enrollment_id: str):
return dyn.collection.get_item(
KeyPair(enrollment_id, '0'),
exc_cls=NotFoundError,
return dyn.collection.get_items(
TransactKey(enrollment_id) + SortKey('0') + SortKey('ORG') + SortKey('LOCK'),
)