@techstuff-dev/foundation-api-utils 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1211,7 +1211,7 @@ var paymentApi = react.createApi({
1211
1211
  }); },
1212
1212
  credentials: 'include',
1213
1213
  }),
1214
- tagTypes: ['UserSubscription', 'Plans'],
1214
+ tagTypes: ['UserSubscription', 'Plans', 'TaxRates', 'PromoCodes'],
1215
1215
  // keepUnusedDataFor: 300,
1216
1216
  endpoints: function (builder) { return ({
1217
1217
  /**
@@ -1233,10 +1233,24 @@ var paymentApi = react.createApi({
1233
1233
  query: function () { return '/payment/plans'; },
1234
1234
  providesTags: ['Plans'],
1235
1235
  }),
1236
+ getTaxRates: builder.query({
1237
+ query: function () { return ({
1238
+ url: '/payment/tax-rates',
1239
+ method: 'GET',
1240
+ }); },
1241
+ providesTags: ['TaxRates'],
1242
+ }),
1243
+ checkPromoCode: builder.query({
1244
+ query: function (promoCode) { return ({
1245
+ url: "/payment/coupon/".concat(promoCode),
1246
+ method: 'GET',
1247
+ }); },
1248
+ providesTags: ['PromoCodes'],
1249
+ }),
1236
1250
  }); },
1237
1251
  });
1238
1252
  // Export hooks for usage in functional components.
1239
- paymentApi.useCheckUserSubscriptionQuery; paymentApi.useLazyCheckUserSubscriptionQuery; paymentApi.useGetPaymentPlansQuery; paymentApi.useLazyGetPaymentPlansQuery;
1253
+ paymentApi.useCheckUserSubscriptionQuery; paymentApi.useLazyCheckUserSubscriptionQuery; paymentApi.useGetPaymentPlansQuery; paymentApi.useLazyGetPaymentPlansQuery; paymentApi.useGetTaxRatesQuery; paymentApi.useLazyGetTaxRatesQuery; paymentApi.useCheckPromoCodeQuery; paymentApi.useLazyCheckPromoCodeQuery;
1240
1254
 
1241
1255
  function applyCoupon(coupon, netTotal) {
1242
1256
  var discountedAmount = netTotal * (Number(coupon.discount) / 100);