Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
feat: subscription offering replace products endpoint (#939)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removed deprecated endpoint and types
  • Loading branch information
rostyk-kanafotskyy authored Jul 2, 2024
1 parent 1a003fb commit 753d046
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
15 changes: 5 additions & 10 deletions src/endpoints/subscription-offerings.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ class SubscriptionOfferingsEndpoint extends CRUDExtend {
})
}

AttachProducts(offeringId, body) {
return this.request.send(`${this.endpoint}/${offeringId}/products/attach`, 'POST', {
...body
})
}

RemoveProduct(offeringId, productId) {
return this.request.send(`${this.endpoint}/${offeringId}/products/${productId}`, 'DELETE')
}

AttachPlans(offeringId, body) {
return this.request.send(`${this.endpoint}/${offeringId}/plans/attach`, 'POST', {
...body
Expand All @@ -64,6 +54,11 @@ class SubscriptionOfferingsEndpoint extends CRUDExtend {
}, undefined, undefined, false)
}

ReplaceProducts(offeringId, productIds) {
return this.request.send(`${this.endpoint}/${offeringId}/products/replace`, 'PUT', {
products: productIds
})
}
}

export default SubscriptionOfferingsEndpoint
6 changes: 2 additions & 4 deletions src/types/subscription-offerings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,11 @@ export interface SubscriptionOfferingsEndpoint

GetAttachedPlans(id: string) : Promise<Resource<SubscriptionOfferingPlan[]>>

AttachProducts(offeringId: string, body: SubscriptionOfferingAttachProductBody): Promise<Resource<SubscriptionProduct[]>>

RemoveProduct(offeringId: string, productId: string): Promise<void>

AttachPlans(offeringId: string, body: SubscriptionOfferingAttachPlanBody): Promise<Resource<SubscriptionPlan[]>>

RemovePlan(offeringId: string, planId: string): Promise<void>

AttachProrationPolicy(offeringId: string, body: SubscriptionOfferingAttachProrationPolicyBody | null): Promise<Resource<SubscriptionOfferingAttachProrationPolicyBody>>

ReplaceProducts(offeringId: string, productIds: string[]): Promise<Resource<SubscriptionProduct[]>>
}

0 comments on commit 753d046

Please sign in to comment.