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

Commit 753d046

Browse files
feat: subscription offering replace products endpoint (#939)
BREAKING CHANGE: removed deprecated endpoint and types
1 parent 1a003fb commit 753d046

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/endpoints/subscription-offerings.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ class SubscriptionOfferingsEndpoint extends CRUDExtend {
3030
})
3131
}
3232

33-
AttachProducts(offeringId, body) {
34-
return this.request.send(`${this.endpoint}/${offeringId}/products/attach`, 'POST', {
35-
...body
36-
})
37-
}
38-
39-
RemoveProduct(offeringId, productId) {
40-
return this.request.send(`${this.endpoint}/${offeringId}/products/${productId}`, 'DELETE')
41-
}
42-
4333
AttachPlans(offeringId, body) {
4434
return this.request.send(`${this.endpoint}/${offeringId}/plans/attach`, 'POST', {
4535
...body
@@ -64,6 +54,11 @@ class SubscriptionOfferingsEndpoint extends CRUDExtend {
6454
}, undefined, undefined, false)
6555
}
6656

57+
ReplaceProducts(offeringId, productIds) {
58+
return this.request.send(`${this.endpoint}/${offeringId}/products/replace`, 'PUT', {
59+
products: productIds
60+
})
61+
}
6762
}
6863

6964
export default SubscriptionOfferingsEndpoint

src/types/subscription-offerings.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,11 @@ export interface SubscriptionOfferingsEndpoint
154154

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

157-
AttachProducts(offeringId: string, body: SubscriptionOfferingAttachProductBody): Promise<Resource<SubscriptionProduct[]>>
158-
159-
RemoveProduct(offeringId: string, productId: string): Promise<void>
160-
161157
AttachPlans(offeringId: string, body: SubscriptionOfferingAttachPlanBody): Promise<Resource<SubscriptionPlan[]>>
162158

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

165161
AttachProrationPolicy(offeringId: string, body: SubscriptionOfferingAttachProrationPolicyBody | null): Promise<Resource<SubscriptionOfferingAttachProrationPolicyBody>>
162+
163+
ReplaceProducts(offeringId: string, productIds: string[]): Promise<Resource<SubscriptionProduct[]>>
166164
}

0 commit comments

Comments
 (0)