remove subscription endpoint
This commit is contained in:
@@ -22,18 +22,6 @@ class PaymentMethod(str, Enum):
|
||||
MANUAL = 'MANUAL'
|
||||
|
||||
|
||||
@router.get('/<org_id>/subscription')
|
||||
def subscription(org_id: str):
|
||||
return dyn.collection.get_item(
|
||||
KeyPair(
|
||||
pk=org_id,
|
||||
sk='METADATA#SUBSCRIPTION',
|
||||
),
|
||||
raise_on_error=False,
|
||||
default={},
|
||||
)
|
||||
|
||||
|
||||
@router.post('/<org_id>/subscription')
|
||||
def add(
|
||||
org_id: str,
|
||||
@@ -44,8 +32,13 @@ def add(
|
||||
now_ = now()
|
||||
|
||||
with dyn.transact_writer() as transact:
|
||||
transact.condition(
|
||||
transact.update(
|
||||
key=KeyPair(org_id, '0'),
|
||||
update_expr='SET subscription_covered = :true, updated_at = :now',
|
||||
expr_attr_values={
|
||||
':true': True,
|
||||
':now': now_,
|
||||
},
|
||||
cond_expr='attribute_exists(sk)',
|
||||
exc_cls=OrgNotFoundError,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user