def admin_subscription_delete_category(subscription_uuid, category_uuid): SubscriptionCategory.delete(subscription_uuid=subscription_uuid, category_uuid=category_uuid) subscription = Subscription.get(uuid=subscription_uuid) return json.dumps(subscription.to_dict()), 200, { 'Content-Type': 'application/json' }
def admin_subscription_add_category(subscription_uuid): category_uuid = json.loads(request.data).get('category_uuid') SubscriptionCategory.create(subscription_uuid=subscription_uuid, category_uuid=category_uuid) subscription = Subscription.get(uuid=subscription_uuid) return json.dumps(subscription.to_dict()), 200, { 'Content-Type': 'application/json' }
def subscription_delete_category(subscription_uuid, category_uuid): SubscriptionCategory.delete(subscription_uuid=subscription_uuid, category_uuid=category_uuid) subscription = Subscription.get(uuid=subscription_uuid) return json.dumps(subscription.to_dict()), 200, {"Content-Type": "application/json"}
def subscription_add_category(subscription_uuid): category_uuid = json.loads(request.data).get("category_uuid") SubscriptionCategory.create(subscription_uuid=subscription_uuid, category_uuid=category_uuid) subscription = Subscription.get(uuid=subscription_uuid) return json.dumps(subscription.to_dict()), 200, {"Content-Type": "application/json"}
def admin_subscription_add_category(subscription_uuid): category_uuid = json.loads(request.data).get('category_uuid') SubscriptionCategory.create(subscription_uuid=subscription_uuid, category_uuid=category_uuid) subscription = Subscription.get(uuid=subscription_uuid) return json.dumps(subscription.to_dict()), 200, {'Content-Type': 'application/json'}