@timardex/cluemart-shared 1.7.56 → 1.7.58

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.
@@ -49,6 +49,7 @@ __export(graphql_exports, {
49
49
  useContactUs: () => useContactUs,
50
50
  useCrawlGoogleMarkets: () => useCrawlGoogleMarkets,
51
51
  useCreateAd: () => useCreateAd,
52
+ useCreateAffiliate: () => useCreateAffiliate,
52
53
  useCreateBulkNotifications: () => useCreateBulkNotifications,
53
54
  useCreateCheckoutSession: () => useCreateCheckoutSession,
54
55
  useCreateCoupon: () => useCreateCoupon,
@@ -4746,6 +4747,17 @@ var import_client77 = require("@apollo/client");
4746
4747
 
4747
4748
  // src/graphql/mutations/affiliate.ts
4748
4749
  var import_client76 = require("@apollo/client");
4750
+ var CREATE_AFFILIATE_MUTATION = import_client76.gql`
4751
+ mutation createAffiliate($input: AffiliateDetailsInputType!) {
4752
+ createAffiliate(input: $input) {
4753
+ data {
4754
+ ...AffiliateFields
4755
+ }
4756
+ message
4757
+ }
4758
+ }
4759
+ ${AFFILIATE_FIELDS_FRAGMENT}
4760
+ `;
4749
4761
  var UPDATE_AFFILIATE_DETAILS_MUTATION = import_client76.gql`
4750
4762
  mutation updateAffiliateDetails(
4751
4763
  $input: AffiliateDetailsInputType!
@@ -4819,6 +4831,17 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = import_client76.gql`
4819
4831
  `;
4820
4832
 
4821
4833
  // src/graphql/hooks/affiliate/hooksMutation.ts
4834
+ var useCreateAffiliate = () => {
4835
+ const [createAffiliate, { loading, error }] = (0, import_client77.useMutation)(CREATE_AFFILIATE_MUTATION, {
4836
+ awaitRefetchQueries: true,
4837
+ refetchQueries: (mutationResult) => {
4838
+ const affiliateId = mutationResult?.data?.createAffiliate?.data?._id;
4839
+ if (!affiliateId) return [];
4840
+ return [{ query: GET_AFFILIATE, variables: { _id: affiliateId } }];
4841
+ }
4842
+ });
4843
+ return { createAffiliate, error, loading };
4844
+ };
4822
4845
  var useUpdateAffiliateDetails = () => {
4823
4846
  const [updateAffiliateDetails, { loading, error }] = (0, import_client77.useMutation)(UPDATE_AFFILIATE_DETAILS_MUTATION, {
4824
4847
  awaitRefetchQueries: true,
@@ -5149,6 +5172,7 @@ var useGetCoupon = (_id) => {
5149
5172
  useContactUs,
5150
5173
  useCrawlGoogleMarkets,
5151
5174
  useCreateAd,
5175
+ useCreateAffiliate,
5152
5176
  useCreateBulkNotifications,
5153
5177
  useCreateCheckoutSession,
5154
5178
  useCreateCoupon,