add address
This commit is contained in:
@@ -19,7 +19,7 @@ dyn = DynamoDBPersistenceLayer(USER_TABLE, dynamodb_client)
|
||||
@router.get('/<org_id>/address')
|
||||
def address(org_id: str):
|
||||
return dyn.collection.get_item(
|
||||
KeyPair(org_id, 'ADDRESS'),
|
||||
KeyPair(org_id, 'METADATA#ADDRESS'),
|
||||
raise_on_error=False,
|
||||
default={},
|
||||
)
|
||||
@@ -44,7 +44,7 @@ class Address(BaseModel):
|
||||
@router.post('/<org_id>/address')
|
||||
def update(org_id: str, address: Annotated[Address, Body(embed=True)]):
|
||||
dyn.collection.put_item(
|
||||
key=KeyPair(org_id, 'ADDRESS'),
|
||||
key=KeyPair(org_id, 'METADATA#ADDRESS'),
|
||||
updated_at=now(),
|
||||
**address.model_dump(exclude_none=True),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user