@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.
@@ -2021,21 +2021,25 @@ function useAffiliateForm(data) {
2021
2021
  resolver: yupResolver18(affiliateSchema)
2022
2022
  });
2023
2023
  useEffect9(() => {
2024
- reset({
2025
- _id: data._id,
2026
- bankAccountDetails: data.bankAccountDetails,
2027
- contactDetails: data.contactDetails,
2028
- email: data.email,
2029
- firstName: data.firstName,
2030
- irdNumber: data.irdNumber,
2031
- lastName: data.lastName,
2032
- location: data.location,
2033
- participantType: data.participantType,
2034
- region: data.region,
2035
- socialMedia: data.socialMedia,
2036
- termsAgreement: data.termsAgreement
2037
- });
2038
- }, [data, reset]);
2024
+ if (data) {
2025
+ reset({
2026
+ _id: data._id,
2027
+ bankAccountDetails: data.bankAccountDetails,
2028
+ contactDetails: data.contactDetails,
2029
+ email: data.email,
2030
+ firstName: data.firstName,
2031
+ irdNumber: data.irdNumber,
2032
+ lastName: data.lastName,
2033
+ location: data.location,
2034
+ participantType: data.participantType,
2035
+ region: data.region,
2036
+ socialMedia: data.socialMedia,
2037
+ termsAgreement: data.termsAgreement
2038
+ });
2039
+ } else {
2040
+ reset(defaultAffiliateFormValues);
2041
+ }
2042
+ }, [data]);
2039
2043
  const {
2040
2044
  _id,
2041
2045
  bankAccountDetails,