@timardex/cluemart-shared 1.4.58 → 1.4.60

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.
package/dist/index.cjs CHANGED
@@ -3658,7 +3658,7 @@ var GET_CHAT_MESSAGE = import_client11.gql`
3658
3658
  var useGetChat = (_id) => {
3659
3659
  const { loading, error, data, refetch } = (0, import_client12.useQuery)(CHAT, {
3660
3660
  fetchPolicy: "network-only",
3661
- skip: !_id,
3661
+ skip: !_id || _id === "",
3662
3662
  variables: { _id }
3663
3663
  });
3664
3664
  const chat = data?.chat;
@@ -3684,7 +3684,7 @@ var useGetChatSubscription = () => {
3684
3684
  var useGetChatsByRegion = (region) => {
3685
3685
  const { loading, error, data, refetch } = (0, import_client12.useQuery)(GET_CHATS_BY_REGION, {
3686
3686
  fetchPolicy: "network-only",
3687
- skip: !region,
3687
+ skip: !region || region === "",
3688
3688
  variables: { region }
3689
3689
  });
3690
3690
  const chatsByRegion = data?.chatsByRegion || [];
@@ -4041,7 +4041,7 @@ var useGetEventsByRegion = (region, options) => {
4041
4041
  };
4042
4042
  const { loading, error, data, refetch, fetchMore } = (0, import_client19.useQuery)(GET_EVENTS_BY_REGION, {
4043
4043
  fetchPolicy: "network-only",
4044
- skip: !region,
4044
+ skip: !region || region === "",
4045
4045
  variables
4046
4046
  });
4047
4047
  const eventsByRegion = data?.eventsByRegion || [];
@@ -4056,7 +4056,7 @@ var useGetEventsByRegion = (region, options) => {
4056
4056
  var useSearchEvents = (search, region) => {
4057
4057
  const { loading, error, data, refetch } = (0, import_client19.useQuery)(SEARCH_EVENTS, {
4058
4058
  fetchPolicy: "network-only",
4059
- skip: search.length < 3,
4059
+ skip: search.length < 3 || !region || region === "",
4060
4060
  variables: { region, search }
4061
4061
  });
4062
4062
  const eventsSearch = data?.eventsSearch || [];
@@ -4079,7 +4079,7 @@ var useGetEventsNearMe = (location) => {
4079
4079
  var useGetEventInfo = (eventId) => {
4080
4080
  const { loading, error, data, refetch } = (0, import_client19.useQuery)(GET_EVENT_INFO, {
4081
4081
  fetchPolicy: "network-only",
4082
- skip: !eventId,
4082
+ skip: !eventId || eventId === "",
4083
4083
  variables: { eventId }
4084
4084
  });
4085
4085
  const eventInfo2 = data?.eventInfo;
@@ -4590,7 +4590,7 @@ var import_client33 = require("@apollo/client");
4590
4590
  var useGetRelation = (_id) => {
4591
4591
  const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_RELATION, {
4592
4592
  fetchPolicy: "network-only",
4593
- skip: !_id,
4593
+ skip: !_id || _id === "",
4594
4594
  variables: { _id }
4595
4595
  });
4596
4596
  const relation = data?.relation;
@@ -4599,7 +4599,7 @@ var useGetRelation = (_id) => {
4599
4599
  var useGetRelationByEventAndVendor = (eventId, vendorId) => {
4600
4600
  const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_RELATION_BY_EVENT_AND_VENDOR, {
4601
4601
  fetchPolicy: "network-only",
4602
- skip: !eventId || !vendorId,
4602
+ skip: !eventId || eventId === "" || !vendorId || vendorId === "",
4603
4603
  variables: { eventId, vendorId }
4604
4604
  });
4605
4605
  const relationByEventAndVendor = data?.relationByEventAndVendor;
@@ -4608,7 +4608,7 @@ var useGetRelationByEventAndVendor = (eventId, vendorId) => {
4608
4608
  var useGetEventRelations = (eventId) => {
4609
4609
  const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_EVENT_RELATIONS, {
4610
4610
  fetchPolicy: "network-only",
4611
- skip: !eventId,
4611
+ skip: !eventId || eventId === "",
4612
4612
  variables: { eventId }
4613
4613
  });
4614
4614
  const eventRelations = data?.eventRelations || [];
@@ -4617,7 +4617,7 @@ var useGetEventRelations = (eventId) => {
4617
4617
  var useGetVendorRelations = (vendorId) => {
4618
4618
  const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_VENDOR_RELATIONS, {
4619
4619
  fetchPolicy: "network-only",
4620
- skip: !vendorId,
4620
+ skip: !vendorId || vendorId === "",
4621
4621
  variables: { vendorId }
4622
4622
  });
4623
4623
  const vendorRelations = data?.vendorRelations || [];
@@ -4626,6 +4626,7 @@ var useGetVendorRelations = (vendorId) => {
4626
4626
  var useGetResourceConnections = (resourceId, resourceType) => {
4627
4627
  const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_RESOURCE_CONNECTIONS, {
4628
4628
  fetchPolicy: "network-only",
4629
+ skip: !resourceId || resourceId === "" || !resourceType,
4629
4630
  variables: { resourceId, resourceType }
4630
4631
  });
4631
4632
  const resourceConnections = data?.resourceConnections;
@@ -4812,7 +4813,7 @@ var useGetVendor = (_id) => {
4812
4813
  GET_VENDOR,
4813
4814
  {
4814
4815
  fetchPolicy: "network-only",
4815
- skip: !_id,
4816
+ skip: !_id || _id === "",
4816
4817
  variables: { _id }
4817
4818
  }
4818
4819
  );
@@ -4822,7 +4823,7 @@ var useGetVendor = (_id) => {
4822
4823
  var useGetVendorsByRegion = (region) => {
4823
4824
  const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_VENDORS_BY_REGION, {
4824
4825
  fetchPolicy: "no-cache",
4825
- skip: !region,
4826
+ skip: !region || region === "",
4826
4827
  variables: { region }
4827
4828
  });
4828
4829
  const vendorsByRegion = data?.vendorsByRegion || [];
@@ -4831,7 +4832,7 @@ var useGetVendorsByRegion = (region) => {
4831
4832
  var useSearchVendors = (search, region) => {
4832
4833
  const { loading, error, data, refetch } = (0, import_client36.useQuery)(SEARCH_VENDORS, {
4833
4834
  fetchPolicy: "network-only",
4834
- skip: search.length < 3,
4835
+ skip: search.length < 3 || !region || region === "",
4835
4836
  variables: { region, search }
4836
4837
  });
4837
4838
  const vendorSearch = data?.vendorSearch || [];
@@ -4840,7 +4841,7 @@ var useSearchVendors = (search, region) => {
4840
4841
  var useGetVendorInfo = (vendorId) => {
4841
4842
  const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_VENDOR_INFO, {
4842
4843
  fetchPolicy: "network-only",
4843
- skip: !vendorId,
4844
+ skip: !vendorId || vendorId === "",
4844
4845
  variables: { vendorId }
4845
4846
  });
4846
4847
  const vendorInfo = data?.vendorInfo;
@@ -4866,7 +4867,7 @@ var useGetUnregisteredVendors = () => {
4866
4867
  var useGetUnregisteredVendor = (_id) => {
4867
4868
  const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_UNREGISTERED_VENDOR, {
4868
4869
  fetchPolicy: "network-only",
4869
- skip: !_id,
4870
+ skip: !_id || _id === "",
4870
4871
  variables: { _id }
4871
4872
  });
4872
4873
  const unregisteredVendor = data?.unregisteredVendor;
@@ -5120,6 +5121,8 @@ var useGetUser = (_id) => {
5120
5121
  const { loading, error, data, refetch } = (0, import_client39.useQuery)(
5121
5122
  GET_USER,
5122
5123
  {
5124
+ fetchPolicy: "network-only",
5125
+ skip: !_id || _id === "",
5123
5126
  variables: { _id }
5124
5127
  }
5125
5128
  );
@@ -5171,7 +5174,7 @@ var useGetUserActivities = () => {
5171
5174
  var useGetUserResources = (userId) => {
5172
5175
  const { loading, error, data, refetch } = (0, import_client39.useQuery)(GET_USER_RESOURCES, {
5173
5176
  fetchPolicy: "network-only",
5174
- skip: !userId,
5177
+ skip: !userId || userId === "",
5175
5178
  variables: { userId }
5176
5179
  });
5177
5180
  const userResources = data?.userResources.resources || [];
@@ -5316,7 +5319,7 @@ var useGetAds = () => {
5316
5319
  var useGetAd = (_id) => {
5317
5320
  const { data, loading, error, refetch } = (0, import_client43.useQuery)(GET_AD, {
5318
5321
  fetchPolicy: "no-cache",
5319
- skip: !_id,
5322
+ skip: !_id || _id === "",
5320
5323
  variables: { _id }
5321
5324
  });
5322
5325
  return {
@@ -5329,7 +5332,7 @@ var useGetAd = (_id) => {
5329
5332
  var useGetAdsByRegion = (region, status) => {
5330
5333
  const { data, loading, error, refetch } = (0, import_client43.useQuery)(GET_ADS_BY_REGION, {
5331
5334
  fetchPolicy: "no-cache",
5332
- skip: !region,
5335
+ skip: !region || region === "",
5333
5336
  variables: { region, status }
5334
5337
  });
5335
5338
  return {
@@ -5658,7 +5661,7 @@ var useGetPartner = (_id) => {
5658
5661
  GET_PARTNER,
5659
5662
  {
5660
5663
  fetchPolicy: "network-only",
5661
- skip: !_id,
5664
+ skip: !_id || _id === "",
5662
5665
  variables: { _id }
5663
5666
  }
5664
5667
  );
@@ -5668,7 +5671,7 @@ var useGetPartner = (_id) => {
5668
5671
  var useGetPartnersByRegion = (region) => {
5669
5672
  const { loading, error, data, refetch } = (0, import_client54.useQuery)(GET_PARTNERS_BY_REGION, {
5670
5673
  fetchPolicy: "no-cache",
5671
- skip: !region,
5674
+ skip: !region || region === "",
5672
5675
  variables: { region }
5673
5676
  });
5674
5677
  const partnersByRegion = data?.partnersByRegion || [];
@@ -5677,7 +5680,7 @@ var useGetPartnersByRegion = (region) => {
5677
5680
  var useSearchPartners = (search, region) => {
5678
5681
  const { loading, error, data, refetch } = (0, import_client54.useQuery)(SEARCH_PARTNERS, {
5679
5682
  fetchPolicy: "network-only",
5680
- skip: search.length < 3,
5683
+ skip: search.length < 3 || !region || region === "",
5681
5684
  variables: { region, search }
5682
5685
  });
5683
5686
  const partnersSearch = data?.partnersSearch || [];
@@ -5831,7 +5834,7 @@ var useGetPosts = () => {
5831
5834
  var useGetPost = (_id) => {
5832
5835
  const { data, loading, error, refetch } = (0, import_client58.useQuery)(GET_POST, {
5833
5836
  fetchPolicy: "network-only",
5834
- skip: !_id,
5837
+ skip: !_id || _id === "",
5835
5838
  variables: { _id }
5836
5839
  });
5837
5840
  return { error, loading, post: data?.post, refetch };
@@ -6550,10 +6553,10 @@ var adSchema = yup6.object().shape({
6550
6553
  }
6551
6554
  )
6552
6555
  }),
6553
- resourceCover: yup6.string().url("Resource cover must be a valid URL").required("Resource cover is required"),
6556
+ resourceCover: yup6.string().required("Resource cover is required"),
6554
6557
  resourceDescription: yup6.string().required("Resource description is required"),
6555
6558
  resourceId: yup6.string().required("Resource ID is required"),
6556
- resourceLogo: yup6.string().url("Resource logo must be a valid URL").nullable().notRequired(),
6559
+ resourceLogo: yup6.string().nullable().notRequired(),
6557
6560
  resourceName: yup6.string().required("Resource name is required"),
6558
6561
  resourceRegion: yup6.string().required("Resource region is required"),
6559
6562
  resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource Type is required"),