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

@@ -51,17 +51,18 @@ class Course(BaseModel):
@router.put('/<course_id>')
def edit_course(course_id: str):
def put_course(course_id: str):
event = router.current_event
if not event.decoded_body:
raise BadRequestError('Invalid request body')
body = BytesIO(event.decoded_body.encode())
course = Course.model_validate(
{'id': course_id, 'cert': {}} | parse(event.headers, body),
)
now_ = now()
body = parse(
event.headers,
BytesIO(event.decoded_body.encode()),
)
course = Course.model_validate({'id': course_id, 'cert': {}} | body)
if course.rawfile:
object_key = f'certs/templates/{course_id}.html'