@timardex/cluemart-shared 1.0.83 → 1.0.85
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/{chunk-3LHMZDI4.mjs → chunk-JIL6JFWC.mjs} +1 -7
- package/dist/chunk-JIL6JFWC.mjs.map +1 -0
- package/dist/{chunk-ZDTBLK7U.mjs → chunk-ORGSRTC4.mjs} +2 -2
- package/dist/enums/index.cjs +0 -7
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +1 -5
- package/dist/enums/index.d.ts +1 -5
- package/dist/enums/index.mjs +1 -3
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +2 -2
- package/dist/graphql/index.cjs +127 -129
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +7 -12
- package/dist/graphql/index.d.ts +7 -12
- package/dist/graphql/index.mjs +124 -125
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.cjs +127 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -16
- package/dist/index.d.ts +7 -16
- package/dist/index.mjs +123 -130
- package/dist/index.mjs.map +1 -1
- package/dist/{notification-Dy46qobo.d.mts → notification-DDVH6HnE.d.mts} +1 -1
- package/dist/{notification-Dy46qobo.d.ts → notification-DDVH6HnE.d.ts} +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-3LHMZDI4.mjs.map +0 -1
- /package/dist/{chunk-ZDTBLK7U.mjs.map → chunk-ORGSRTC4.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -42,11 +42,6 @@ var EnumNotification = /* @__PURE__ */ ((EnumNotification2) => {
|
|
|
42
42
|
EnumNotification2["STALLHOLDER_APPLICATION_TO_MARKET"] = "stallholder_application_to_market" /* STALLHOLDER_APPLICATION_TO_MARKET */;
|
|
43
43
|
return EnumNotification2;
|
|
44
44
|
})(EnumNotification || {});
|
|
45
|
-
var EnumResourceTypeIcon = /* @__PURE__ */ ((EnumResourceTypeIcon2) => {
|
|
46
|
-
EnumResourceTypeIcon2["MARKET"] = "compass";
|
|
47
|
-
EnumResourceTypeIcon2["STALLHOLDER"] = "store";
|
|
48
|
-
return EnumResourceTypeIcon2;
|
|
49
|
-
})(EnumResourceTypeIcon || {});
|
|
50
45
|
var EnumRegions = /* @__PURE__ */ ((EnumRegions2) => {
|
|
51
46
|
EnumRegions2["Auckland"] = "Auckland";
|
|
52
47
|
EnumRegions2["BayOfPlentyGisborne"] = "Bay of Plenty & Gisborne";
|
|
@@ -2346,6 +2341,14 @@ var USER_CHATS = gql6`
|
|
|
2346
2341
|
}
|
|
2347
2342
|
${CHAT_FIELDS_FRAGMENT}
|
|
2348
2343
|
`;
|
|
2344
|
+
var GET_CHAT_MESSAGE = gql6`
|
|
2345
|
+
subscription {
|
|
2346
|
+
getChatMessage {
|
|
2347
|
+
...ChatFields
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
${CHAT_FIELDS_FRAGMENT}
|
|
2351
|
+
`;
|
|
2349
2352
|
|
|
2350
2353
|
// src/graphql/mutations/chat.ts
|
|
2351
2354
|
var CREATE_CHAT_MUTATION = gql7`
|
|
@@ -2470,19 +2473,6 @@ var useRemoveParticipantFromChat = () => {
|
|
|
2470
2473
|
|
|
2471
2474
|
// src/graphql/hooks/chat/hooksQuery.ts
|
|
2472
2475
|
import { useQuery, useSubscription } from "@apollo/client";
|
|
2473
|
-
|
|
2474
|
-
// src/graphql/subscriptions/chat.ts
|
|
2475
|
-
import { gql as gql8 } from "@apollo/client";
|
|
2476
|
-
var GET_CHAT_MESSAGE = gql8`
|
|
2477
|
-
subscription {
|
|
2478
|
-
getChatMessage {
|
|
2479
|
-
...ChatFields
|
|
2480
|
-
}
|
|
2481
|
-
}
|
|
2482
|
-
${CHAT_FIELDS_FRAGMENT}
|
|
2483
|
-
`;
|
|
2484
|
-
|
|
2485
|
-
// src/graphql/hooks/chat/hooksQuery.ts
|
|
2486
2476
|
var useGetChat = (_id) => {
|
|
2487
2477
|
const { loading, error, data, refetch } = useQuery(CHAT, {
|
|
2488
2478
|
fetchPolicy: "network-only",
|
|
@@ -2509,8 +2499,8 @@ var useGetChatSubscription = () => {
|
|
|
2509
2499
|
import { useMutation as useMutation4 } from "@apollo/client";
|
|
2510
2500
|
|
|
2511
2501
|
// src/graphql/mutations/contactUs.ts
|
|
2512
|
-
import { gql as
|
|
2513
|
-
var CONTACT_US_MUTATION =
|
|
2502
|
+
import { gql as gql8 } from "@apollo/client";
|
|
2503
|
+
var CONTACT_US_MUTATION = gql8`
|
|
2514
2504
|
mutation contactUs($input: ContactUsInputType!) {
|
|
2515
2505
|
contactUs(input: $input) {
|
|
2516
2506
|
message
|
|
@@ -2528,8 +2518,8 @@ var useContactUs = () => {
|
|
|
2528
2518
|
import { useMutation as useMutation5 } from "@apollo/client";
|
|
2529
2519
|
|
|
2530
2520
|
// src/graphql/mutations/market.ts
|
|
2531
|
-
import { gql as
|
|
2532
|
-
var CREATE_MARKET_MUTATION =
|
|
2521
|
+
import { gql as gql9 } from "@apollo/client";
|
|
2522
|
+
var CREATE_MARKET_MUTATION = gql9`
|
|
2533
2523
|
mutation createMarket($input: MarketInputType!) {
|
|
2534
2524
|
createMarket(input: $input) {
|
|
2535
2525
|
...MarketFields
|
|
@@ -2537,7 +2527,7 @@ var CREATE_MARKET_MUTATION = gql10`
|
|
|
2537
2527
|
}
|
|
2538
2528
|
${MARKET}
|
|
2539
2529
|
`;
|
|
2540
|
-
var UPDATE_MARKET_MUTATION =
|
|
2530
|
+
var UPDATE_MARKET_MUTATION = gql9`
|
|
2541
2531
|
mutation updateMarket($_id: ID!, $input: MarketInputType!) {
|
|
2542
2532
|
updateMarket(_id: $_id, input: $input) {
|
|
2543
2533
|
...MarketFields
|
|
@@ -2545,12 +2535,12 @@ var UPDATE_MARKET_MUTATION = gql10`
|
|
|
2545
2535
|
}
|
|
2546
2536
|
${MARKET}
|
|
2547
2537
|
`;
|
|
2548
|
-
var DELETE_MARKET_MUTATION =
|
|
2538
|
+
var DELETE_MARKET_MUTATION = gql9`
|
|
2549
2539
|
mutation deleteMarket($_id: ID!) {
|
|
2550
2540
|
deleteMarket(_id: $_id)
|
|
2551
2541
|
}
|
|
2552
2542
|
`;
|
|
2553
|
-
var CREATE_MARKET_INFO_MUTATION =
|
|
2543
|
+
var CREATE_MARKET_INFO_MUTATION = gql9`
|
|
2554
2544
|
mutation createMarketInfo($input: MarketInfoInputType!) {
|
|
2555
2545
|
createMarketInfo(input: $input) {
|
|
2556
2546
|
...MarketInfoFields
|
|
@@ -2558,7 +2548,7 @@ var CREATE_MARKET_INFO_MUTATION = gql10`
|
|
|
2558
2548
|
}
|
|
2559
2549
|
${MARKET_INFO}
|
|
2560
2550
|
`;
|
|
2561
|
-
var UPDATE_MARKET_INFO_MUTATION =
|
|
2551
|
+
var UPDATE_MARKET_INFO_MUTATION = gql9`
|
|
2562
2552
|
mutation updateMarketInfo($_id: ID!, $input: MarketInfoInputType!) {
|
|
2563
2553
|
updateMarketInfo(_id: $_id, input: $input) {
|
|
2564
2554
|
...MarketInfoFields
|
|
@@ -2568,8 +2558,8 @@ var UPDATE_MARKET_INFO_MUTATION = gql10`
|
|
|
2568
2558
|
`;
|
|
2569
2559
|
|
|
2570
2560
|
// src/graphql/queries/user.ts
|
|
2571
|
-
import { gql as
|
|
2572
|
-
var GET_USERS =
|
|
2561
|
+
import { gql as gql10 } from "@apollo/client";
|
|
2562
|
+
var GET_USERS = gql10`
|
|
2573
2563
|
query getUsers {
|
|
2574
2564
|
users {
|
|
2575
2565
|
...UserFields
|
|
@@ -2577,7 +2567,7 @@ var GET_USERS = gql11`
|
|
|
2577
2567
|
}
|
|
2578
2568
|
${USER_FIELDS_FRAGMENT}
|
|
2579
2569
|
`;
|
|
2580
|
-
var GET_USER =
|
|
2570
|
+
var GET_USER = gql10`
|
|
2581
2571
|
query getUser($_id: ID!) {
|
|
2582
2572
|
user(_id: $_id) {
|
|
2583
2573
|
...UserFields
|
|
@@ -2585,7 +2575,7 @@ var GET_USER = gql11`
|
|
|
2585
2575
|
}
|
|
2586
2576
|
${USER_FIELDS_FRAGMENT}
|
|
2587
2577
|
`;
|
|
2588
|
-
var GET_USER_MARKETS =
|
|
2578
|
+
var GET_USER_MARKETS = gql10`
|
|
2589
2579
|
query getUserMarkets {
|
|
2590
2580
|
userMarkets {
|
|
2591
2581
|
...MarketFields
|
|
@@ -2593,7 +2583,7 @@ var GET_USER_MARKETS = gql11`
|
|
|
2593
2583
|
}
|
|
2594
2584
|
${MARKET}
|
|
2595
2585
|
`;
|
|
2596
|
-
var GET_USER_STALLHOLDER =
|
|
2586
|
+
var GET_USER_STALLHOLDER = gql10`
|
|
2597
2587
|
query getUserStallholder {
|
|
2598
2588
|
userStallholder {
|
|
2599
2589
|
...StallholderFields
|
|
@@ -2601,7 +2591,7 @@ var GET_USER_STALLHOLDER = gql11`
|
|
|
2601
2591
|
}
|
|
2602
2592
|
${STALLHOLDER}
|
|
2603
2593
|
`;
|
|
2604
|
-
var GET_USER_FAVOURITES =
|
|
2594
|
+
var GET_USER_FAVOURITES = gql10`
|
|
2605
2595
|
query getUserFavourites {
|
|
2606
2596
|
userFavourites {
|
|
2607
2597
|
markets {
|
|
@@ -2763,13 +2753,13 @@ var useGetMarketInfo = (marketId) => {
|
|
|
2763
2753
|
import { useMutation as useMutation6 } from "@apollo/client";
|
|
2764
2754
|
|
|
2765
2755
|
// src/graphql/mutations/notification.ts
|
|
2766
|
-
import { gql as
|
|
2756
|
+
import { gql as gql12 } from "@apollo/client";
|
|
2767
2757
|
|
|
2768
2758
|
// src/graphql/queries/notification.ts
|
|
2769
|
-
import { gql as
|
|
2770
|
-
var USER_NOTIFICATION_FRAGMENT =
|
|
2759
|
+
import { gql as gql11 } from "@apollo/client";
|
|
2760
|
+
var USER_NOTIFICATION_FRAGMENT = gql11`
|
|
2771
2761
|
fragment UserNotificationFields on Notification {
|
|
2772
|
-
|
|
2762
|
+
_id
|
|
2773
2763
|
userId
|
|
2774
2764
|
title
|
|
2775
2765
|
message
|
|
@@ -2780,33 +2770,15 @@ var USER_NOTIFICATION_FRAGMENT = gql12`
|
|
|
2780
2770
|
updatedAt
|
|
2781
2771
|
}
|
|
2782
2772
|
`;
|
|
2783
|
-
var GET_USER_NOTIFICATIONS =
|
|
2784
|
-
query getUserNotifications(
|
|
2785
|
-
$userId:
|
|
2786
|
-
$limit: Int
|
|
2787
|
-
$offset: Int
|
|
2788
|
-
$isRead: String
|
|
2789
|
-
) {
|
|
2790
|
-
userNotifications(
|
|
2791
|
-
userId: $userId
|
|
2792
|
-
limit: $limit
|
|
2793
|
-
offset: $offset
|
|
2794
|
-
isRead: $isRead
|
|
2795
|
-
) {
|
|
2796
|
-
...UserNotificationFields
|
|
2797
|
-
}
|
|
2798
|
-
}
|
|
2799
|
-
${USER_NOTIFICATION_FRAGMENT}
|
|
2800
|
-
`;
|
|
2801
|
-
var GET_UNREAD_NOTIFICATIONS = gql12`
|
|
2802
|
-
query getUnreadNotifications($userId: String!, $limit: Int) {
|
|
2803
|
-
unreadNotifications(userId: $userId, limit: $limit) {
|
|
2773
|
+
var GET_USER_NOTIFICATIONS = gql11`
|
|
2774
|
+
query getUserNotifications($userId: String!, $limit: Int, $offset: Int) {
|
|
2775
|
+
userNotifications(userId: $userId, limit: $limit, offset: $offset) {
|
|
2804
2776
|
...UserNotificationFields
|
|
2805
2777
|
}
|
|
2806
2778
|
}
|
|
2807
2779
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2808
2780
|
`;
|
|
2809
|
-
var GET_NOTIFICATION_COUNT =
|
|
2781
|
+
var GET_NOTIFICATION_COUNT = gql11`
|
|
2810
2782
|
query getNotificationCount($userId: String!) {
|
|
2811
2783
|
notificationCount(userId: $userId) {
|
|
2812
2784
|
total
|
|
@@ -2816,7 +2788,7 @@ var GET_NOTIFICATION_COUNT = gql12`
|
|
|
2816
2788
|
`;
|
|
2817
2789
|
|
|
2818
2790
|
// src/graphql/mutations/notification.ts
|
|
2819
|
-
var CREATE_NOTIFICATION =
|
|
2791
|
+
var CREATE_NOTIFICATION = gql12`
|
|
2820
2792
|
mutation createNotification($input: CreateNotificationInput!) {
|
|
2821
2793
|
createNotification(input: $input) {
|
|
2822
2794
|
...UserNotificationFields
|
|
@@ -2824,7 +2796,7 @@ var CREATE_NOTIFICATION = gql13`
|
|
|
2824
2796
|
}
|
|
2825
2797
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2826
2798
|
`;
|
|
2827
|
-
var CREATE_BULK_NOTIFICATIONS =
|
|
2799
|
+
var CREATE_BULK_NOTIFICATIONS = gql12`
|
|
2828
2800
|
mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
2829
2801
|
createBulkNotifications(input: $input) {
|
|
2830
2802
|
...UserNotificationFields
|
|
@@ -2832,7 +2804,7 @@ var CREATE_BULK_NOTIFICATIONS = gql13`
|
|
|
2832
2804
|
}
|
|
2833
2805
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2834
2806
|
`;
|
|
2835
|
-
var MARK_NOTIFICATION_READ =
|
|
2807
|
+
var MARK_NOTIFICATION_READ = gql12`
|
|
2836
2808
|
mutation markNotificationRead($input: MarkNotificationReadInput!) {
|
|
2837
2809
|
markNotificationRead(input: $input) {
|
|
2838
2810
|
...UserNotificationFields
|
|
@@ -2840,11 +2812,16 @@ var MARK_NOTIFICATION_READ = gql13`
|
|
|
2840
2812
|
}
|
|
2841
2813
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2842
2814
|
`;
|
|
2843
|
-
var MARK_ALL_NOTIFICATIONS_READ =
|
|
2815
|
+
var MARK_ALL_NOTIFICATIONS_READ = gql12`
|
|
2844
2816
|
mutation markAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
|
|
2845
2817
|
markAllNotificationsRead(input: $input)
|
|
2846
2818
|
}
|
|
2847
2819
|
`;
|
|
2820
|
+
var DELETE_NOTIFICATION = gql12`
|
|
2821
|
+
mutation deleteNotification($_id: ID!) {
|
|
2822
|
+
deleteNotification(_id: $_id)
|
|
2823
|
+
}
|
|
2824
|
+
`;
|
|
2848
2825
|
|
|
2849
2826
|
// src/graphql/hooks/notifications/hooksMutation.ts
|
|
2850
2827
|
var useCreateNotification = () => {
|
|
@@ -2859,70 +2836,88 @@ var useCreateBulkNotifications = () => {
|
|
|
2859
2836
|
};
|
|
2860
2837
|
var useMarkNotificationRead = () => {
|
|
2861
2838
|
const [markNotificationRead, { loading, error }] = useMutation6(
|
|
2862
|
-
MARK_NOTIFICATION_READ
|
|
2839
|
+
MARK_NOTIFICATION_READ,
|
|
2840
|
+
{
|
|
2841
|
+
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
2842
|
+
}
|
|
2863
2843
|
);
|
|
2864
2844
|
return { error, loading, markNotificationRead };
|
|
2865
2845
|
};
|
|
2866
2846
|
var useMarkAllNotificationsRead = () => {
|
|
2867
2847
|
const [markAllNotificationsRead, { loading, error }] = useMutation6(
|
|
2868
|
-
MARK_ALL_NOTIFICATIONS_READ
|
|
2848
|
+
MARK_ALL_NOTIFICATIONS_READ,
|
|
2849
|
+
{
|
|
2850
|
+
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
2851
|
+
}
|
|
2869
2852
|
);
|
|
2870
2853
|
return { error, loading, markAllNotificationsRead };
|
|
2871
2854
|
};
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
fetchPolicy: "no-cache",
|
|
2878
|
-
skip: !userId,
|
|
2879
|
-
variables: {
|
|
2880
|
-
isRead,
|
|
2881
|
-
limit: limit ?? 50,
|
|
2882
|
-
offset: offset ?? 0,
|
|
2883
|
-
userId
|
|
2855
|
+
var useDeleteNotification = () => {
|
|
2856
|
+
const [deleteNotification, { loading, error }] = useMutation6(
|
|
2857
|
+
DELETE_NOTIFICATION,
|
|
2858
|
+
{
|
|
2859
|
+
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
2884
2860
|
}
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
return {
|
|
2888
|
-
error,
|
|
2889
|
-
loading,
|
|
2890
|
-
notifications,
|
|
2891
|
-
refetch
|
|
2892
|
-
};
|
|
2861
|
+
);
|
|
2862
|
+
return { deleteNotification, error, loading };
|
|
2893
2863
|
};
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2864
|
+
|
|
2865
|
+
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
2866
|
+
import { useSubscription as useSubscription2 } from "@apollo/client";
|
|
2867
|
+
|
|
2868
|
+
// src/graphql/subscriptions/notification.ts
|
|
2869
|
+
import { gql as gql13 } from "@apollo/client";
|
|
2870
|
+
var USER_NOTIFICATION_FRAGMENT2 = gql13`
|
|
2871
|
+
fragment UserNotificationFields on Notification {
|
|
2872
|
+
_id
|
|
2873
|
+
userId
|
|
2874
|
+
title
|
|
2875
|
+
message
|
|
2876
|
+
type
|
|
2877
|
+
isRead
|
|
2878
|
+
data
|
|
2879
|
+
createdAt
|
|
2880
|
+
updatedAt
|
|
2881
|
+
}
|
|
2882
|
+
`;
|
|
2883
|
+
var GET_USER_NOTIFICATIONS_SUBSCRIPTION = gql13`
|
|
2884
|
+
subscription getUserNotifications($userId: String!) {
|
|
2885
|
+
getUserNotifications(userId: $userId) {
|
|
2886
|
+
...UserNotificationFields
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
${USER_NOTIFICATION_FRAGMENT2}
|
|
2890
|
+
`;
|
|
2891
|
+
var GET_NOTIFICATION_COUNT_SUBSCRIPTION = gql13`
|
|
2892
|
+
subscription getNotificationCount($userId: String!) {
|
|
2893
|
+
getNotificationCount(userId: $userId) {
|
|
2894
|
+
total
|
|
2895
|
+
unread
|
|
2902
2896
|
}
|
|
2897
|
+
}
|
|
2898
|
+
`;
|
|
2899
|
+
|
|
2900
|
+
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
2901
|
+
var useGetUserNotificationsSubscription = (userId) => {
|
|
2902
|
+
const { data, loading, error } = useSubscription2(GET_USER_NOTIFICATIONS_SUBSCRIPTION, {
|
|
2903
|
+
skip: !userId,
|
|
2904
|
+
variables: { userId }
|
|
2903
2905
|
});
|
|
2904
|
-
const notifications = data?.unreadNotifications;
|
|
2905
2906
|
return {
|
|
2906
2907
|
error,
|
|
2907
2908
|
loading,
|
|
2908
|
-
notifications
|
|
2909
|
-
refetch
|
|
2909
|
+
notifications: data?.getUserNotifications || []
|
|
2910
2910
|
};
|
|
2911
2911
|
};
|
|
2912
|
-
var
|
|
2913
|
-
const { data,
|
|
2914
|
-
fetchPolicy: "no-cache",
|
|
2912
|
+
var useGetNotificationCountSubscription = (userId) => {
|
|
2913
|
+
const { data, loading, error } = useSubscription2(GET_NOTIFICATION_COUNT_SUBSCRIPTION, {
|
|
2915
2914
|
skip: !userId,
|
|
2916
|
-
variables: {
|
|
2917
|
-
userId
|
|
2918
|
-
}
|
|
2915
|
+
variables: { userId }
|
|
2919
2916
|
});
|
|
2920
|
-
const notificationCount = data?.notificationCount;
|
|
2921
2917
|
return {
|
|
2922
2918
|
error,
|
|
2923
2919
|
loading,
|
|
2924
|
-
notificationCount,
|
|
2925
|
-
refetch
|
|
2920
|
+
notificationCount: data?.getNotificationCount || { total: 0, unread: 0 }
|
|
2926
2921
|
};
|
|
2927
2922
|
};
|
|
2928
2923
|
|
|
@@ -3321,9 +3316,9 @@ var useDeleteRelation = () => {
|
|
|
3321
3316
|
};
|
|
3322
3317
|
|
|
3323
3318
|
// src/graphql/hooks/relation/hooksQuery.ts
|
|
3324
|
-
import { useQuery as
|
|
3319
|
+
import { useQuery as useQuery3 } from "@apollo/client";
|
|
3325
3320
|
var useGetRelation = (id) => {
|
|
3326
|
-
const { loading, error, data, refetch } =
|
|
3321
|
+
const { loading, error, data, refetch } = useQuery3(GET_RELATION, {
|
|
3327
3322
|
fetchPolicy: "network-only",
|
|
3328
3323
|
skip: id === "",
|
|
3329
3324
|
variables: { id }
|
|
@@ -3332,7 +3327,7 @@ var useGetRelation = (id) => {
|
|
|
3332
3327
|
return { error, loading, refetch, relation };
|
|
3333
3328
|
};
|
|
3334
3329
|
var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
3335
|
-
const { loading, error, data, refetch } =
|
|
3330
|
+
const { loading, error, data, refetch } = useQuery3(
|
|
3336
3331
|
GET_RELATION_BY_MARKET_AND_STALLHOLDER,
|
|
3337
3332
|
{
|
|
3338
3333
|
fetchPolicy: "network-only",
|
|
@@ -3344,7 +3339,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
|
3344
3339
|
return { error, loading, refetch, relationByMarketAndStallholder };
|
|
3345
3340
|
};
|
|
3346
3341
|
var useGetMarketRelations = (marketId) => {
|
|
3347
|
-
const { loading, error, data, refetch } =
|
|
3342
|
+
const { loading, error, data, refetch } = useQuery3(GET_MARKET_RELATIONS, {
|
|
3348
3343
|
fetchPolicy: "network-only",
|
|
3349
3344
|
skip: marketId === "",
|
|
3350
3345
|
variables: { marketId }
|
|
@@ -3353,7 +3348,7 @@ var useGetMarketRelations = (marketId) => {
|
|
|
3353
3348
|
return { error, loading, marketRelations, refetch };
|
|
3354
3349
|
};
|
|
3355
3350
|
var useGetStallholderRelations = (stallholderId) => {
|
|
3356
|
-
const { loading, error, data, refetch } =
|
|
3351
|
+
const { loading, error, data, refetch } = useQuery3(
|
|
3357
3352
|
GET_STALLHOLDER_RELATIONS,
|
|
3358
3353
|
{
|
|
3359
3354
|
fetchPolicy: "network-only",
|
|
@@ -3365,7 +3360,7 @@ var useGetStallholderRelations = (stallholderId) => {
|
|
|
3365
3360
|
return { error, loading, refetch, stallholderRelations };
|
|
3366
3361
|
};
|
|
3367
3362
|
var useGetResourceConnections = (resourceId, resourceType) => {
|
|
3368
|
-
const { loading, error, data, refetch } =
|
|
3363
|
+
const { loading, error, data, refetch } = useQuery3(GET_RESOURCE_CONNECTIONS, {
|
|
3369
3364
|
fetchPolicy: "network-only",
|
|
3370
3365
|
variables: { resourceId, resourceType }
|
|
3371
3366
|
});
|
|
@@ -3499,9 +3494,9 @@ var useUpdateStallholderInfo = () => {
|
|
|
3499
3494
|
};
|
|
3500
3495
|
|
|
3501
3496
|
// src/graphql/hooks/stallholder/hooksQuery.ts
|
|
3502
|
-
import { useQuery as
|
|
3497
|
+
import { useQuery as useQuery4 } from "@apollo/client";
|
|
3503
3498
|
var useGetStallholders = () => {
|
|
3504
|
-
const { loading, error, data, refetch } =
|
|
3499
|
+
const { loading, error, data, refetch } = useQuery4(GET_STALLHOLDERS, {
|
|
3505
3500
|
fetchPolicy: "network-only"
|
|
3506
3501
|
});
|
|
3507
3502
|
const stallholders = data?.stallholders;
|
|
@@ -3513,7 +3508,7 @@ var useGetStallholders = () => {
|
|
|
3513
3508
|
};
|
|
3514
3509
|
};
|
|
3515
3510
|
var useGetStallholder = (_id) => {
|
|
3516
|
-
const { loading, error, data, refetch } =
|
|
3511
|
+
const { loading, error, data, refetch } = useQuery4(GET_STALLHOLDER, {
|
|
3517
3512
|
fetchPolicy: "network-only",
|
|
3518
3513
|
skip: !_id,
|
|
3519
3514
|
variables: { _id }
|
|
@@ -3522,7 +3517,7 @@ var useGetStallholder = (_id) => {
|
|
|
3522
3517
|
return { error, loading, refetch, stallholder };
|
|
3523
3518
|
};
|
|
3524
3519
|
var useGetStallholdersByRegion = (region) => {
|
|
3525
|
-
const { loading, error, data, refetch } =
|
|
3520
|
+
const { loading, error, data, refetch } = useQuery4(
|
|
3526
3521
|
GET_STALLHOLDERS_BY_REGION,
|
|
3527
3522
|
{
|
|
3528
3523
|
fetchPolicy: "no-cache",
|
|
@@ -3534,7 +3529,7 @@ var useGetStallholdersByRegion = (region) => {
|
|
|
3534
3529
|
return { error, loading, refetch, stallholdersByRegion };
|
|
3535
3530
|
};
|
|
3536
3531
|
var useSearchStallholders = (search, region) => {
|
|
3537
|
-
const { loading, error, data, refetch } =
|
|
3532
|
+
const { loading, error, data, refetch } = useQuery4(SEARCH_STALLHOLDERS, {
|
|
3538
3533
|
fetchPolicy: "network-only",
|
|
3539
3534
|
skip: search.length < 3,
|
|
3540
3535
|
variables: { region, search }
|
|
@@ -3543,7 +3538,7 @@ var useSearchStallholders = (search, region) => {
|
|
|
3543
3538
|
return { error, loading, refetch, stallholderSearch };
|
|
3544
3539
|
};
|
|
3545
3540
|
var useGetStallholderInfo = (stallholderId) => {
|
|
3546
|
-
const { loading, error, data, refetch } =
|
|
3541
|
+
const { loading, error, data, refetch } = useQuery4(GET_STALLHOLDER_INFO, {
|
|
3547
3542
|
fetchPolicy: "network-only",
|
|
3548
3543
|
skip: !stallholderId,
|
|
3549
3544
|
variables: { stallholderId }
|
|
@@ -3649,9 +3644,9 @@ var useDeleteTester = () => {
|
|
|
3649
3644
|
};
|
|
3650
3645
|
|
|
3651
3646
|
// src/graphql/hooks/testers/hooksQuery.ts
|
|
3652
|
-
import { useQuery as
|
|
3647
|
+
import { useQuery as useQuery5 } from "@apollo/client";
|
|
3653
3648
|
var useGetTesters = () => {
|
|
3654
|
-
const { data, loading, error, refetch } =
|
|
3649
|
+
const { data, loading, error, refetch } = useQuery5(GET_TESTERS);
|
|
3655
3650
|
const testers = data?.testers;
|
|
3656
3651
|
return {
|
|
3657
3652
|
error,
|
|
@@ -3661,7 +3656,7 @@ var useGetTesters = () => {
|
|
|
3661
3656
|
};
|
|
3662
3657
|
};
|
|
3663
3658
|
var useGetTester = (_id) => {
|
|
3664
|
-
const { data, loading, error, refetch } =
|
|
3659
|
+
const { data, loading, error, refetch } = useQuery5(GET_TESTER, {
|
|
3665
3660
|
skip: !_id,
|
|
3666
3661
|
variables: { _id }
|
|
3667
3662
|
});
|
|
@@ -3770,37 +3765,37 @@ var useRemoveUserFavouriteResource = () => {
|
|
|
3770
3765
|
};
|
|
3771
3766
|
|
|
3772
3767
|
// src/graphql/hooks/user/hooksQuery.ts
|
|
3773
|
-
import { useQuery as
|
|
3768
|
+
import { useQuery as useQuery6 } from "@apollo/client";
|
|
3774
3769
|
var useGetUsers = () => {
|
|
3775
|
-
const { loading, error, data, refetch } =
|
|
3770
|
+
const { loading, error, data, refetch } = useQuery6(GET_USERS, {
|
|
3776
3771
|
fetchPolicy: "network-only"
|
|
3777
3772
|
});
|
|
3778
3773
|
const users = data?.users;
|
|
3779
3774
|
return { error, loading, refetch, users };
|
|
3780
3775
|
};
|
|
3781
3776
|
var useGetUser = (_id) => {
|
|
3782
|
-
const { loading, error, data, refetch } =
|
|
3777
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER, {
|
|
3783
3778
|
variables: { _id }
|
|
3784
3779
|
});
|
|
3785
3780
|
const user = data?.user;
|
|
3786
3781
|
return { error, loading, refetch, user };
|
|
3787
3782
|
};
|
|
3788
3783
|
var useGetUserMarkets = () => {
|
|
3789
|
-
const { loading, error, data, refetch } =
|
|
3784
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER_MARKETS, {
|
|
3790
3785
|
fetchPolicy: "network-only"
|
|
3791
3786
|
});
|
|
3792
3787
|
const userMarkets = data?.userMarkets;
|
|
3793
3788
|
return { error, loading, refetch, userMarkets };
|
|
3794
3789
|
};
|
|
3795
3790
|
var useGetUserStallholder = () => {
|
|
3796
|
-
const { loading, error, data, refetch } =
|
|
3791
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER_STALLHOLDER, {
|
|
3797
3792
|
fetchPolicy: "network-only"
|
|
3798
3793
|
});
|
|
3799
3794
|
const userStallholder = data?.userStallholder;
|
|
3800
3795
|
return { error, loading, refetch, userStallholder };
|
|
3801
3796
|
};
|
|
3802
3797
|
var useGetUserFavourites = () => {
|
|
3803
|
-
const { loading, error, data, refetch } =
|
|
3798
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER_FAVOURITES, {
|
|
3804
3799
|
fetchPolicy: "network-only"
|
|
3805
3800
|
});
|
|
3806
3801
|
const markets = data?.userFavourites.markets;
|
|
@@ -5055,11 +5050,9 @@ export {
|
|
|
5055
5050
|
EnumRegions,
|
|
5056
5051
|
EnumRelationResource,
|
|
5057
5052
|
EnumResourceType,
|
|
5058
|
-
EnumResourceTypeIcon,
|
|
5059
5053
|
EnumSocialMedia,
|
|
5060
5054
|
EnumUserLicence,
|
|
5061
5055
|
EnumUserRole,
|
|
5062
|
-
GET_CHAT_MESSAGE,
|
|
5063
5056
|
ImageTypeEnum,
|
|
5064
5057
|
SAVED_EMAIL_KEY,
|
|
5065
5058
|
SAVED_PASSWORD_KEY,
|
|
@@ -5147,6 +5140,7 @@ export {
|
|
|
5147
5140
|
useCreateUser,
|
|
5148
5141
|
useDeleteChat,
|
|
5149
5142
|
useDeleteMarket,
|
|
5143
|
+
useDeleteNotification,
|
|
5150
5144
|
useDeleteRelation,
|
|
5151
5145
|
useDeleteStallholder,
|
|
5152
5146
|
useDeleteTester,
|
|
@@ -5159,7 +5153,7 @@ export {
|
|
|
5159
5153
|
useGetMarkets,
|
|
5160
5154
|
useGetMarketsByRegion,
|
|
5161
5155
|
useGetMarketsNearMe,
|
|
5162
|
-
|
|
5156
|
+
useGetNotificationCountSubscription,
|
|
5163
5157
|
useGetRelation,
|
|
5164
5158
|
useGetRelationByMarketAndStallholder,
|
|
5165
5159
|
useGetResourceConnections,
|
|
@@ -5170,12 +5164,11 @@ export {
|
|
|
5170
5164
|
useGetStallholdersByRegion,
|
|
5171
5165
|
useGetTester,
|
|
5172
5166
|
useGetTesters,
|
|
5173
|
-
useGetUnreadNotifications,
|
|
5174
5167
|
useGetUser,
|
|
5175
5168
|
useGetUserChats,
|
|
5176
5169
|
useGetUserFavourites,
|
|
5177
5170
|
useGetUserMarkets,
|
|
5178
|
-
|
|
5171
|
+
useGetUserNotificationsSubscription,
|
|
5179
5172
|
useGetUserStallholder,
|
|
5180
5173
|
useGetUsers,
|
|
5181
5174
|
useLocationSearch,
|