@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.
@@ -23,7 +23,7 @@ import {
23
23
  } from "../chunk-5D2JVHC2.mjs";
24
24
  import "../chunk-RAYUJODN.mjs";
25
25
  import "../chunk-DQ7ZHIXW.mjs";
26
- import "../chunk-MGSDQSWS.mjs";
26
+ import "../chunk-WRV55PDR.mjs";
27
27
  import "../chunk-VBQ5RF7L.mjs";
28
28
  import {
29
29
  EnumEventDateStatus,
package/dist/index.cjs CHANGED
@@ -333,6 +333,7 @@ __export(index_exports, {
333
333
  useContactUs: () => useContactUs,
334
334
  useCrawlGoogleMarkets: () => useCrawlGoogleMarkets,
335
335
  useCreateAd: () => useCreateAd,
336
+ useCreateAffiliate: () => useCreateAffiliate,
336
337
  useCreateBulkNotifications: () => useCreateBulkNotifications,
337
338
  useCreateCheckoutSession: () => useCreateCheckoutSession,
338
339
  useCreateCoupon: () => useCreateCoupon,
@@ -8327,6 +8328,17 @@ var import_client77 = require("@apollo/client");
8327
8328
 
8328
8329
  // src/graphql/mutations/affiliate.ts
8329
8330
  var import_client76 = require("@apollo/client");
8331
+ var CREATE_AFFILIATE_MUTATION = import_client76.gql`
8332
+ mutation createAffiliate($input: AffiliateDetailsInputType!) {
8333
+ createAffiliate(input: $input) {
8334
+ data {
8335
+ ...AffiliateFields
8336
+ }
8337
+ message
8338
+ }
8339
+ }
8340
+ ${AFFILIATE_FIELDS_FRAGMENT}
8341
+ `;
8330
8342
  var UPDATE_AFFILIATE_DETAILS_MUTATION = import_client76.gql`
8331
8343
  mutation updateAffiliateDetails(
8332
8344
  $input: AffiliateDetailsInputType!
@@ -8400,6 +8412,17 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = import_client76.gql`
8400
8412
  `;
8401
8413
 
8402
8414
  // src/graphql/hooks/affiliate/hooksMutation.ts
8415
+ var useCreateAffiliate = () => {
8416
+ const [createAffiliate, { loading, error }] = (0, import_client77.useMutation)(CREATE_AFFILIATE_MUTATION, {
8417
+ awaitRefetchQueries: true,
8418
+ refetchQueries: (mutationResult) => {
8419
+ const affiliateId = mutationResult?.data?.createAffiliate?.data?._id;
8420
+ if (!affiliateId) return [];
8421
+ return [{ query: GET_AFFILIATE, variables: { _id: affiliateId } }];
8422
+ }
8423
+ });
8424
+ return { createAffiliate, error, loading };
8425
+ };
8403
8426
  var useUpdateAffiliateDetails = () => {
8404
8427
  const [updateAffiliateDetails, { loading, error }] = (0, import_client77.useMutation)(UPDATE_AFFILIATE_DETAILS_MUTATION, {
8405
8428
  awaitRefetchQueries: true,
@@ -9558,6 +9581,7 @@ function canAccessAdminPath(roles, pathname) {
9558
9581
  useContactUs,
9559
9582
  useCrawlGoogleMarkets,
9560
9583
  useCreateAd,
9584
+ useCreateAffiliate,
9561
9585
  useCreateBulkNotifications,
9562
9586
  useCreateCheckoutSession,
9563
9587
  useCreateCoupon,