@timardex/cluemart-shared 1.5.835 → 1.5.836

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.
@@ -6830,21 +6830,25 @@ function useAffiliateForm(data) {
6830
6830
  resolver: (0, import_yup18.yupResolver)(affiliateSchema)
6831
6831
  });
6832
6832
  (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]);
6833
+ if (data) {
6834
+ reset({
6835
+ _id: data._id,
6836
+ bankAccountDetails: data.bankAccountDetails,
6837
+ contactDetails: data.contactDetails,
6838
+ email: data.email,
6839
+ firstName: data.firstName,
6840
+ irdNumber: data.irdNumber,
6841
+ lastName: data.lastName,
6842
+ location: data.location,
6843
+ participantType: data.participantType,
6844
+ region: data.region,
6845
+ socialMedia: data.socialMedia,
6846
+ termsAgreement: data.termsAgreement
6847
+ });
6848
+ } else {
6849
+ reset(defaultAffiliateFormValues);
6850
+ }
6851
+ }, [data]);
6848
6852
  const {
6849
6853
  _id,
6850
6854
  bankAccountDetails,