@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.mjs CHANGED
@@ -3377,7 +3377,7 @@ var GET_CHAT_MESSAGE = gql8`
3377
3377
  var useGetChat = (_id) => {
3378
3378
  const { loading, error, data, refetch } = useQuery(CHAT, {
3379
3379
  fetchPolicy: "network-only",
3380
- skip: !_id,
3380
+ skip: !_id || _id === "",
3381
3381
  variables: { _id }
3382
3382
  });
3383
3383
  const chat = data?.chat;
@@ -3403,7 +3403,7 @@ var useGetChatSubscription = () => {
3403
3403
  var useGetChatsByRegion = (region) => {
3404
3404
  const { loading, error, data, refetch } = useQuery(GET_CHATS_BY_REGION, {
3405
3405
  fetchPolicy: "network-only",
3406
- skip: !region,
3406
+ skip: !region || region === "",
3407
3407
  variables: { region }
3408
3408
  });
3409
3409
  const chatsByRegion = data?.chatsByRegion || [];
@@ -3760,7 +3760,7 @@ var useGetEventsByRegion = (region, options) => {
3760
3760
  };
3761
3761
  const { loading, error, data, refetch, fetchMore } = useQuery2(GET_EVENTS_BY_REGION, {
3762
3762
  fetchPolicy: "network-only",
3763
- skip: !region,
3763
+ skip: !region || region === "",
3764
3764
  variables
3765
3765
  });
3766
3766
  const eventsByRegion = data?.eventsByRegion || [];
@@ -3775,7 +3775,7 @@ var useGetEventsByRegion = (region, options) => {
3775
3775
  var useSearchEvents = (search, region) => {
3776
3776
  const { loading, error, data, refetch } = useQuery2(SEARCH_EVENTS, {
3777
3777
  fetchPolicy: "network-only",
3778
- skip: search.length < 3,
3778
+ skip: search.length < 3 || !region || region === "",
3779
3779
  variables: { region, search }
3780
3780
  });
3781
3781
  const eventsSearch = data?.eventsSearch || [];
@@ -3798,7 +3798,7 @@ var useGetEventsNearMe = (location) => {
3798
3798
  var useGetEventInfo = (eventId) => {
3799
3799
  const { loading, error, data, refetch } = useQuery2(GET_EVENT_INFO, {
3800
3800
  fetchPolicy: "network-only",
3801
- skip: !eventId,
3801
+ skip: !eventId || eventId === "",
3802
3802
  variables: { eventId }
3803
3803
  });
3804
3804
  const eventInfo2 = data?.eventInfo;
@@ -4309,7 +4309,7 @@ import { useQuery as useQuery4 } from "@apollo/client";
4309
4309
  var useGetRelation = (_id) => {
4310
4310
  const { loading, error, data, refetch } = useQuery4(GET_RELATION, {
4311
4311
  fetchPolicy: "network-only",
4312
- skip: !_id,
4312
+ skip: !_id || _id === "",
4313
4313
  variables: { _id }
4314
4314
  });
4315
4315
  const relation = data?.relation;
@@ -4318,7 +4318,7 @@ var useGetRelation = (_id) => {
4318
4318
  var useGetRelationByEventAndVendor = (eventId, vendorId) => {
4319
4319
  const { loading, error, data, refetch } = useQuery4(GET_RELATION_BY_EVENT_AND_VENDOR, {
4320
4320
  fetchPolicy: "network-only",
4321
- skip: !eventId || !vendorId,
4321
+ skip: !eventId || eventId === "" || !vendorId || vendorId === "",
4322
4322
  variables: { eventId, vendorId }
4323
4323
  });
4324
4324
  const relationByEventAndVendor = data?.relationByEventAndVendor;
@@ -4327,7 +4327,7 @@ var useGetRelationByEventAndVendor = (eventId, vendorId) => {
4327
4327
  var useGetEventRelations = (eventId) => {
4328
4328
  const { loading, error, data, refetch } = useQuery4(GET_EVENT_RELATIONS, {
4329
4329
  fetchPolicy: "network-only",
4330
- skip: !eventId,
4330
+ skip: !eventId || eventId === "",
4331
4331
  variables: { eventId }
4332
4332
  });
4333
4333
  const eventRelations = data?.eventRelations || [];
@@ -4336,7 +4336,7 @@ var useGetEventRelations = (eventId) => {
4336
4336
  var useGetVendorRelations = (vendorId) => {
4337
4337
  const { loading, error, data, refetch } = useQuery4(GET_VENDOR_RELATIONS, {
4338
4338
  fetchPolicy: "network-only",
4339
- skip: !vendorId,
4339
+ skip: !vendorId || vendorId === "",
4340
4340
  variables: { vendorId }
4341
4341
  });
4342
4342
  const vendorRelations = data?.vendorRelations || [];
@@ -4345,6 +4345,7 @@ var useGetVendorRelations = (vendorId) => {
4345
4345
  var useGetResourceConnections = (resourceId, resourceType) => {
4346
4346
  const { loading, error, data, refetch } = useQuery4(GET_RESOURCE_CONNECTIONS, {
4347
4347
  fetchPolicy: "network-only",
4348
+ skip: !resourceId || resourceId === "" || !resourceType,
4348
4349
  variables: { resourceId, resourceType }
4349
4350
  });
4350
4351
  const resourceConnections = data?.resourceConnections;
@@ -4531,7 +4532,7 @@ var useGetVendor = (_id) => {
4531
4532
  GET_VENDOR,
4532
4533
  {
4533
4534
  fetchPolicy: "network-only",
4534
- skip: !_id,
4535
+ skip: !_id || _id === "",
4535
4536
  variables: { _id }
4536
4537
  }
4537
4538
  );
@@ -4541,7 +4542,7 @@ var useGetVendor = (_id) => {
4541
4542
  var useGetVendorsByRegion = (region) => {
4542
4543
  const { loading, error, data, refetch } = useQuery5(GET_VENDORS_BY_REGION, {
4543
4544
  fetchPolicy: "no-cache",
4544
- skip: !region,
4545
+ skip: !region || region === "",
4545
4546
  variables: { region }
4546
4547
  });
4547
4548
  const vendorsByRegion = data?.vendorsByRegion || [];
@@ -4550,7 +4551,7 @@ var useGetVendorsByRegion = (region) => {
4550
4551
  var useSearchVendors = (search, region) => {
4551
4552
  const { loading, error, data, refetch } = useQuery5(SEARCH_VENDORS, {
4552
4553
  fetchPolicy: "network-only",
4553
- skip: search.length < 3,
4554
+ skip: search.length < 3 || !region || region === "",
4554
4555
  variables: { region, search }
4555
4556
  });
4556
4557
  const vendorSearch = data?.vendorSearch || [];
@@ -4559,7 +4560,7 @@ var useSearchVendors = (search, region) => {
4559
4560
  var useGetVendorInfo = (vendorId) => {
4560
4561
  const { loading, error, data, refetch } = useQuery5(GET_VENDOR_INFO, {
4561
4562
  fetchPolicy: "network-only",
4562
- skip: !vendorId,
4563
+ skip: !vendorId || vendorId === "",
4563
4564
  variables: { vendorId }
4564
4565
  });
4565
4566
  const vendorInfo = data?.vendorInfo;
@@ -4585,7 +4586,7 @@ var useGetUnregisteredVendors = () => {
4585
4586
  var useGetUnregisteredVendor = (_id) => {
4586
4587
  const { loading, error, data, refetch } = useQuery5(GET_UNREGISTERED_VENDOR, {
4587
4588
  fetchPolicy: "network-only",
4588
- skip: !_id,
4589
+ skip: !_id || _id === "",
4589
4590
  variables: { _id }
4590
4591
  });
4591
4592
  const unregisteredVendor = data?.unregisteredVendor;
@@ -4839,6 +4840,8 @@ var useGetUser = (_id) => {
4839
4840
  const { loading, error, data, refetch } = useQuery6(
4840
4841
  GET_USER,
4841
4842
  {
4843
+ fetchPolicy: "network-only",
4844
+ skip: !_id || _id === "",
4842
4845
  variables: { _id }
4843
4846
  }
4844
4847
  );
@@ -4890,7 +4893,7 @@ var useGetUserActivities = () => {
4890
4893
  var useGetUserResources = (userId) => {
4891
4894
  const { loading, error, data, refetch } = useQuery6(GET_USER_RESOURCES, {
4892
4895
  fetchPolicy: "network-only",
4893
- skip: !userId,
4896
+ skip: !userId || userId === "",
4894
4897
  variables: { userId }
4895
4898
  });
4896
4899
  const userResources = data?.userResources.resources || [];
@@ -5035,7 +5038,7 @@ var useGetAds = () => {
5035
5038
  var useGetAd = (_id) => {
5036
5039
  const { data, loading, error, refetch } = useQuery7(GET_AD, {
5037
5040
  fetchPolicy: "no-cache",
5038
- skip: !_id,
5041
+ skip: !_id || _id === "",
5039
5042
  variables: { _id }
5040
5043
  });
5041
5044
  return {
@@ -5048,7 +5051,7 @@ var useGetAd = (_id) => {
5048
5051
  var useGetAdsByRegion = (region, status) => {
5049
5052
  const { data, loading, error, refetch } = useQuery7(GET_ADS_BY_REGION, {
5050
5053
  fetchPolicy: "no-cache",
5051
- skip: !region,
5054
+ skip: !region || region === "",
5052
5055
  variables: { region, status }
5053
5056
  });
5054
5057
  return {
@@ -5377,7 +5380,7 @@ var useGetPartner = (_id) => {
5377
5380
  GET_PARTNER,
5378
5381
  {
5379
5382
  fetchPolicy: "network-only",
5380
- skip: !_id,
5383
+ skip: !_id || _id === "",
5381
5384
  variables: { _id }
5382
5385
  }
5383
5386
  );
@@ -5387,7 +5390,7 @@ var useGetPartner = (_id) => {
5387
5390
  var useGetPartnersByRegion = (region) => {
5388
5391
  const { loading, error, data, refetch } = useQuery10(GET_PARTNERS_BY_REGION, {
5389
5392
  fetchPolicy: "no-cache",
5390
- skip: !region,
5393
+ skip: !region || region === "",
5391
5394
  variables: { region }
5392
5395
  });
5393
5396
  const partnersByRegion = data?.partnersByRegion || [];
@@ -5396,7 +5399,7 @@ var useGetPartnersByRegion = (region) => {
5396
5399
  var useSearchPartners = (search, region) => {
5397
5400
  const { loading, error, data, refetch } = useQuery10(SEARCH_PARTNERS, {
5398
5401
  fetchPolicy: "network-only",
5399
- skip: search.length < 3,
5402
+ skip: search.length < 3 || !region || region === "",
5400
5403
  variables: { region, search }
5401
5404
  });
5402
5405
  const partnersSearch = data?.partnersSearch || [];
@@ -5550,7 +5553,7 @@ var useGetPosts = () => {
5550
5553
  var useGetPost = (_id) => {
5551
5554
  const { data, loading, error, refetch } = useQuery11(GET_POST, {
5552
5555
  fetchPolicy: "network-only",
5553
- skip: !_id,
5556
+ skip: !_id || _id === "",
5554
5557
  variables: { _id }
5555
5558
  });
5556
5559
  return { error, loading, post: data?.post, refetch };
@@ -6269,10 +6272,10 @@ var adSchema = yup6.object().shape({
6269
6272
  }
6270
6273
  )
6271
6274
  }),
6272
- resourceCover: yup6.string().url("Resource cover must be a valid URL").required("Resource cover is required"),
6275
+ resourceCover: yup6.string().required("Resource cover is required"),
6273
6276
  resourceDescription: yup6.string().required("Resource description is required"),
6274
6277
  resourceId: yup6.string().required("Resource ID is required"),
6275
- resourceLogo: yup6.string().url("Resource logo must be a valid URL").nullable().notRequired(),
6278
+ resourceLogo: yup6.string().nullable().notRequired(),
6276
6279
  resourceName: yup6.string().required("Resource name is required"),
6277
6280
  resourceRegion: yup6.string().required("Resource region is required"),
6278
6281
  resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource Type is required"),