update menu

This commit is contained in:
2025-11-18 19:23:47 -03:00
parent cd5f96210f
commit b439b1e038
3 changed files with 112 additions and 32 deletions

View File

@@ -64,7 +64,8 @@ def put_course(course_id: str):
event = router.current_event
if not event.decoded_body:
raise BadRequestError('Invalid request body') now_ = now()
raise BadRequestError('Invalid request body')
body = parse(
event.headers,
BytesIO(event.decoded_body.encode()),
@@ -98,7 +99,7 @@ def put_course(course_id: str):
':cert': course.cert.model_dump(),
':access_period': course.access_period,
':draft': course.draft,
':updated_at': now_,
':updated_at': now(),
},
cond_expr='attribute_exists(sk)',
exc_cls=BadRequestError,

View File

@@ -21,5 +21,9 @@ dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
@router.get('/<enrollment_id>')
def get_enrollment(enrollment_id: str):
return dyn.collection.get_items(
TransactKey(enrollment_id) + SortKey('0') + SortKey('ORG') + SortKey('LOCK')
TransactKey(enrollment_id)
+ SortKey('0')
+ SortKey('ORG', rename_key='org')
+ SortKey('CANCEL_POLICY', rename_key='cancel_policy')
+ SortKey('LOCK', rename_key='lock')
)