@timardex/cluemart-shared 1.5.835 → 1.5.837

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.
Files changed (34) hide show
  1. package/dist/{affiliate-DSZKkCju.d.ts → affiliate-DWonTXNb.d.ts} +1 -2
  2. package/dist/{affiliate-C0wLdUpL.d.mts → affiliate-DmvU25zu.d.mts} +1 -2
  3. package/dist/{chunk-QBU7N4P2.mjs → chunk-A7IXLYYS.mjs} +2 -2
  4. package/dist/{chunk-L4DYYGRX.mjs → chunk-EAO3C6JU.mjs} +1 -2
  5. package/dist/{chunk-L4DYYGRX.mjs.map → chunk-EAO3C6JU.mjs.map} +1 -1
  6. package/dist/{chunk-OBZTGPBJ.mjs → chunk-QMJB5OJ4.mjs} +1 -1
  7. package/dist/{chunk-OBZTGPBJ.mjs.map → chunk-QMJB5OJ4.mjs.map} +1 -1
  8. package/dist/formFields/index.mjs +2 -2
  9. package/dist/graphql/index.cjs +0 -1
  10. package/dist/graphql/index.cjs.map +1 -1
  11. package/dist/graphql/index.d.mts +1 -1
  12. package/dist/graphql/index.d.ts +1 -1
  13. package/dist/graphql/index.mjs +1 -1
  14. package/dist/hooks/index.cjs +16 -37
  15. package/dist/hooks/index.cjs.map +1 -1
  16. package/dist/hooks/index.d.mts +3 -3
  17. package/dist/hooks/index.d.ts +3 -3
  18. package/dist/hooks/index.mjs +19 -39
  19. package/dist/hooks/index.mjs.map +1 -1
  20. package/dist/index.cjs +0 -1
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.mts +1 -2
  23. package/dist/index.d.ts +1 -2
  24. package/dist/index.mjs +0 -1
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/types/index.cjs.map +1 -1
  27. package/dist/types/index.d.mts +1 -1
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/index.mjs +1 -1
  30. package/dist/utils/index.d.mts +1 -1
  31. package/dist/utils/index.d.ts +1 -1
  32. package/dist/utils/index.mjs +2 -2
  33. package/package.json +1 -1
  34. /package/dist/{chunk-QBU7N4P2.mjs.map → chunk-A7IXLYYS.mjs.map} +0 -0
@@ -5,7 +5,7 @@ import { A as AuthPayloadType, R as RefreshTokenPayloadType, P as PartnerType, a
5
5
  import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-BDIjVrI4.mjs';
6
6
  import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-BHwZPjT8.mjs';
7
7
  import { S as SafeUserType, R as RedeemRewardResponse, b as ResourceByUser, c as SubscriptionPlansResponse, d as SubscriptionStatusData } from '../user-Bhkd3l06.mjs';
8
- import { A as AffiliateType } from '../affiliate-C0wLdUpL.mjs';
8
+ import { A as AffiliateType } from '../affiliate-DmvU25zu.mjs';
9
9
  import '../images/index.mjs';
10
10
  import 'react-hook-form';
11
11
 
@@ -5,7 +5,7 @@ import { A as AuthPayloadType, R as RefreshTokenPayloadType, P as PartnerType, a
5
5
  import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-JNcJxpTh.js';
6
6
  import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global--iSLy2cE.js';
7
7
  import { S as SafeUserType, R as RedeemRewardResponse, b as ResourceByUser, c as SubscriptionPlansResponse, d as SubscriptionStatusData } from '../user-C_kCo0Fm.js';
8
- import { A as AffiliateType } from '../affiliate-DSZKkCju.js';
8
+ import { A as AffiliateType } from '../affiliate-DWonTXNb.js';
9
9
  import '../images/index.js';
10
10
  import 'react-hook-form';
11
11
 
@@ -136,7 +136,7 @@ import {
136
136
  useUpdateUser,
137
137
  useUpdateVendor,
138
138
  useUpdateVendorInfo
139
- } from "../chunk-L4DYYGRX.mjs";
139
+ } from "../chunk-EAO3C6JU.mjs";
140
140
  import {
141
141
  GET_EVENT,
142
142
  GET_EVENT_INFO,
@@ -5130,7 +5130,6 @@ var AFFILIATE_DETAILS_FIELDS_FRAGMENT = import_client74.gql`
5130
5130
  location {
5131
5131
  ...LocationFields
5132
5132
  }
5133
- region
5134
5133
  socialMedia {
5135
5134
  ...SocialMediaFields
5136
5135
  }
@@ -5602,17 +5601,13 @@ var defaultAffiliateFormValues = {
5602
5601
  contactDetails: {
5603
5602
  mobilePhone: ""
5604
5603
  },
5605
- email: "",
5606
- firstName: "",
5607
5604
  irdNumber: "",
5608
- lastName: "",
5609
5605
  location: defaultLocation,
5610
5606
  participantType: "",
5611
- region: "",
5612
5607
  socialMedia: null,
5613
5608
  termsAgreement: null
5614
5609
  };
5615
- function mapAffiliateToFormData(affiliate, userDefaults) {
5610
+ function mapAffiliateToFormData(affiliate) {
5616
5611
  return {
5617
5612
  _id: affiliate._id,
5618
5613
  bankAccountDetails: affiliate.affiliateDetails?.bankAccountDetails ?? {
@@ -5622,13 +5617,9 @@ function mapAffiliateToFormData(affiliate, userDefaults) {
5622
5617
  contactDetails: affiliate.affiliateDetails?.contactDetails ?? {
5623
5618
  mobilePhone: ""
5624
5619
  },
5625
- email: affiliate.affiliateDetails?.email || userDefaults?.email || "",
5626
- firstName: affiliate.affiliateDetails?.firstName || userDefaults?.firstName || "",
5627
5620
  irdNumber: affiliate.affiliateDetails?.irdNumber ?? "",
5628
- lastName: affiliate.affiliateDetails?.lastName || userDefaults?.lastName || "",
5629
5621
  location: affiliate.affiliateDetails?.location ?? defaultLocation,
5630
5622
  participantType: affiliate.affiliateDetails?.participantType ?? "",
5631
- region: (affiliate.affiliateDetails?.region ?? userDefaults?.preferredRegion) || "",
5632
5623
  socialMedia: affiliate.affiliateDetails?.socialMedia ?? null,
5633
5624
  termsAgreement: affiliate.affiliateDetails?.termsAgreement ?? null
5634
5625
  };
@@ -6795,8 +6786,6 @@ var affiliateSchema = yup12.object().shape({
6795
6786
  contactDetails: affiliateContactDetailsSchema.required(
6796
6787
  "Contact details are required"
6797
6788
  ),
6798
- email: yup12.string().trim().required("Email is required"),
6799
- firstName: yup12.string().trim().required("First name is required"),
6800
6789
  irdNumber: yup12.string().trim().required("IRD number is required").matches(
6801
6790
  nzIrdNumberRegex,
6802
6791
  "IRD number must be in format: XXX-XXX-XX or XXX-XXX-XXX"
@@ -6805,13 +6794,11 @@ var affiliateSchema = yup12.object().shape({
6805
6794
  "Enter a valid IRD number",
6806
6795
  (value) => !!value && isValidIrdNumber(value)
6807
6796
  ),
6808
- lastName: yup12.string().trim().required("Last name is required"),
6809
6797
  location: locationSchema.required("Location is required"),
6810
6798
  participantType: yup12.mixed().oneOf(
6811
6799
  Object.values(EnumAffiliateParticipantType),
6812
6800
  "Please select a valid participant type"
6813
6801
  ).required("Participant type is required"),
6814
- region: yup12.string().trim().required("Region is required"),
6815
6802
  socialMedia: yup12.array().of(socialMediaSchema).nullable().default(null)
6816
6803
  });
6817
6804
 
@@ -6830,32 +6817,28 @@ function useAffiliateForm(data) {
6830
6817
  resolver: (0, import_yup18.yupResolver)(affiliateSchema)
6831
6818
  });
6832
6819
  (0, import_react6.useEffect)(() => {
6833
- reset({
6834
- _id: data._id,
6835
- bankAccountDetails: data.bankAccountDetails,
6836
- contactDetails: data.contactDetails,
6837
- email: data.email,
6838
- firstName: data.firstName,
6839
- irdNumber: data.irdNumber,
6840
- lastName: data.lastName,
6841
- location: data.location,
6842
- participantType: data.participantType,
6843
- region: data.region,
6844
- socialMedia: data.socialMedia,
6845
- termsAgreement: data.termsAgreement
6846
- });
6847
- }, [data, reset]);
6820
+ if (data) {
6821
+ reset({
6822
+ _id: data._id,
6823
+ bankAccountDetails: data.bankAccountDetails,
6824
+ contactDetails: data.contactDetails,
6825
+ irdNumber: data.irdNumber,
6826
+ location: data.location,
6827
+ participantType: data.participantType,
6828
+ socialMedia: data.socialMedia,
6829
+ termsAgreement: data.termsAgreement
6830
+ });
6831
+ } else {
6832
+ reset(defaultAffiliateFormValues);
6833
+ }
6834
+ }, [data]);
6848
6835
  const {
6849
6836
  _id,
6850
6837
  bankAccountDetails,
6851
6838
  contactDetails,
6852
- email,
6853
- firstName,
6854
6839
  irdNumber,
6855
- lastName,
6856
6840
  location,
6857
6841
  participantType,
6858
- region,
6859
6842
  socialMedia: socialMedia2,
6860
6843
  termsAgreement
6861
6844
  } = getValues();
@@ -6865,13 +6848,9 @@ function useAffiliateForm(data) {
6865
6848
  _id,
6866
6849
  bankAccountDetails,
6867
6850
  contactDetails,
6868
- email,
6869
- firstName,
6870
6851
  irdNumber,
6871
- lastName,
6872
6852
  location,
6873
6853
  participantType,
6874
- region,
6875
6854
  socialMedia: socialMedia2,
6876
6855
  termsAgreement
6877
6856
  },