Просмотр исходного кода

Upper-case for all methods

This is required by the fetch-api.

GitOrigin-RevId: 641c63ad2fe6b9d01c48c28faf669051de8f3271
andrew rumble 2 лет назад
Родитель
Сommit
8af5fa0378

+ 4 - 4
services/web/app/src/Features/Subscription/RecurlyWrapper.js

@@ -579,7 +579,7 @@ const promises = {
   async attemptInvoiceCollection(invoiceId) {
     return await RecurlyWrapper.promises.apiRequest({
       url: `invoices/${invoiceId}/collect`,
-      method: 'put',
+      method: 'PUT',
     })
   },
 
@@ -639,7 +639,7 @@ const promises = {
     try {
       await RecurlyWrapper.promises.apiRequest({
         url: 'coupons',
-        method: 'post',
+        method: 'POST',
         body: requestBody,
       })
     } catch (error) {
@@ -677,7 +677,7 @@ const promises = {
     try {
       await RecurlyWrapper.promises.apiRequest({
         url: `coupons/${couponCode}/redeem`,
-        method: 'post',
+        method: 'POST',
         body: requestBody,
       })
     } catch (error) {
@@ -703,7 +703,7 @@ const promises = {
       await RecurlyWrapper.promises.apiRequest({
         url: `subscriptions/${subscriptionId}/postpone`,
         qs: { bulk: false, next_bill_date: nextRenewalDate },
-        method: 'put',
+        method: 'PUT',
       })
     } catch (error) {
       logger.warn(

+ 1 - 1
services/web/test/unit/src/Subscription/RecurlyWrapperTests.js

@@ -378,7 +378,7 @@ describe('RecurlyWrapper', function () {
         .stub(this.RecurlyWrapper.promises, 'apiRequest')
         .callsFake(options => {
           options.url.should.equal(`coupons/${this.coupon_code}/redeem`)
-          options.method.should.equal('post')
+          options.method.should.equal('POST')
           return {}
         })
       await this.RecurlyWrapper.promises.redeemCoupon(