@timardex/cluemart-shared 1.5.802 → 1.5.803

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.
@@ -5216,6 +5216,14 @@ var DELETE_AFFILIATE_MUTATION = gql41`
5216
5216
  deleteAffiliate(_id: $_id)
5217
5217
  }
5218
5218
  `;
5219
+ var REDEEM_AFFILIATE_REWARD_MUTATION = gql41`
5220
+ mutation redeemAffiliateReward($affiliateId: ID!) {
5221
+ redeemAffiliateReward(affiliateId: $affiliateId) {
5222
+ ...AffiliateFields
5223
+ }
5224
+ }
5225
+ ${AFFILIATE_FIELDS_FRAGMENT}
5226
+ `;
5219
5227
 
5220
5228
  // src/graphql/hooks/affiliate/hooksMutation.ts
5221
5229
  var useUpdateAffiliateDetails = () => {
@@ -5242,6 +5250,20 @@ var useDeleteAffiliate = () => {
5242
5250
  );
5243
5251
  return { deleteAffiliate, error, loading };
5244
5252
  };
5253
+ var useRedeemAffiliateReward = () => {
5254
+ const [redeemAffiliateReward, { loading, error }] = useMutation20(
5255
+ REDEEM_AFFILIATE_REWARD_MUTATION,
5256
+ {
5257
+ awaitRefetchQueries: true,
5258
+ refetchQueries: (mutationResult) => {
5259
+ const affiliateId = mutationResult?.data?.redeemAffiliateReward?._id;
5260
+ if (!affiliateId) return [];
5261
+ return [{ query: GET_AFFILIATE, variables: { _id: affiliateId } }];
5262
+ }
5263
+ }
5264
+ );
5265
+ return { error, loading, redeemAffiliateReward };
5266
+ };
5245
5267
 
5246
5268
  export {
5247
5269
  GET_EVENT,
@@ -5396,6 +5418,7 @@ export {
5396
5418
  useGetAffiliate,
5397
5419
  useGetAffiliates,
5398
5420
  useUpdateAffiliateDetails,
5399
- useDeleteAffiliate
5421
+ useDeleteAffiliate,
5422
+ useRedeemAffiliateReward
5400
5423
  };
5401
- //# sourceMappingURL=chunk-3NDZHCTN.mjs.map
5424
+ //# sourceMappingURL=chunk-G76ILLVZ.mjs.map