@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/graphql/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-JIL6JFWC.mjs";
|
|
2
2
|
|
|
3
3
|
// src/graphql/hooks/admin/hooksMutation.ts
|
|
4
4
|
import { useMutation } from "@apollo/client";
|
|
@@ -548,6 +548,14 @@ var USER_CHATS = gql6`
|
|
|
548
548
|
}
|
|
549
549
|
${CHAT_FIELDS_FRAGMENT}
|
|
550
550
|
`;
|
|
551
|
+
var GET_CHAT_MESSAGE = gql6`
|
|
552
|
+
subscription {
|
|
553
|
+
getChatMessage {
|
|
554
|
+
...ChatFields
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
${CHAT_FIELDS_FRAGMENT}
|
|
558
|
+
`;
|
|
551
559
|
|
|
552
560
|
// src/graphql/mutations/chat.ts
|
|
553
561
|
var CREATE_CHAT_MUTATION = gql7`
|
|
@@ -672,19 +680,6 @@ var useRemoveParticipantFromChat = () => {
|
|
|
672
680
|
|
|
673
681
|
// src/graphql/hooks/chat/hooksQuery.ts
|
|
674
682
|
import { useQuery, useSubscription } from "@apollo/client";
|
|
675
|
-
|
|
676
|
-
// src/graphql/subscriptions/chat.ts
|
|
677
|
-
import { gql as gql8 } from "@apollo/client";
|
|
678
|
-
var GET_CHAT_MESSAGE = gql8`
|
|
679
|
-
subscription {
|
|
680
|
-
getChatMessage {
|
|
681
|
-
...ChatFields
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
${CHAT_FIELDS_FRAGMENT}
|
|
685
|
-
`;
|
|
686
|
-
|
|
687
|
-
// src/graphql/hooks/chat/hooksQuery.ts
|
|
688
683
|
var useGetChat = (_id) => {
|
|
689
684
|
const { loading, error, data, refetch } = useQuery(CHAT, {
|
|
690
685
|
fetchPolicy: "network-only",
|
|
@@ -711,8 +706,8 @@ var useGetChatSubscription = () => {
|
|
|
711
706
|
import { useMutation as useMutation4 } from "@apollo/client";
|
|
712
707
|
|
|
713
708
|
// src/graphql/mutations/contactUs.ts
|
|
714
|
-
import { gql as
|
|
715
|
-
var CONTACT_US_MUTATION =
|
|
709
|
+
import { gql as gql8 } from "@apollo/client";
|
|
710
|
+
var CONTACT_US_MUTATION = gql8`
|
|
716
711
|
mutation contactUs($input: ContactUsInputType!) {
|
|
717
712
|
contactUs(input: $input) {
|
|
718
713
|
message
|
|
@@ -730,8 +725,8 @@ var useContactUs = () => {
|
|
|
730
725
|
import { useMutation as useMutation5 } from "@apollo/client";
|
|
731
726
|
|
|
732
727
|
// src/graphql/mutations/market.ts
|
|
733
|
-
import { gql as
|
|
734
|
-
var CREATE_MARKET_MUTATION =
|
|
728
|
+
import { gql as gql9 } from "@apollo/client";
|
|
729
|
+
var CREATE_MARKET_MUTATION = gql9`
|
|
735
730
|
mutation createMarket($input: MarketInputType!) {
|
|
736
731
|
createMarket(input: $input) {
|
|
737
732
|
...MarketFields
|
|
@@ -739,7 +734,7 @@ var CREATE_MARKET_MUTATION = gql10`
|
|
|
739
734
|
}
|
|
740
735
|
${MARKET}
|
|
741
736
|
`;
|
|
742
|
-
var UPDATE_MARKET_MUTATION =
|
|
737
|
+
var UPDATE_MARKET_MUTATION = gql9`
|
|
743
738
|
mutation updateMarket($_id: ID!, $input: MarketInputType!) {
|
|
744
739
|
updateMarket(_id: $_id, input: $input) {
|
|
745
740
|
...MarketFields
|
|
@@ -747,12 +742,12 @@ var UPDATE_MARKET_MUTATION = gql10`
|
|
|
747
742
|
}
|
|
748
743
|
${MARKET}
|
|
749
744
|
`;
|
|
750
|
-
var DELETE_MARKET_MUTATION =
|
|
745
|
+
var DELETE_MARKET_MUTATION = gql9`
|
|
751
746
|
mutation deleteMarket($_id: ID!) {
|
|
752
747
|
deleteMarket(_id: $_id)
|
|
753
748
|
}
|
|
754
749
|
`;
|
|
755
|
-
var CREATE_MARKET_INFO_MUTATION =
|
|
750
|
+
var CREATE_MARKET_INFO_MUTATION = gql9`
|
|
756
751
|
mutation createMarketInfo($input: MarketInfoInputType!) {
|
|
757
752
|
createMarketInfo(input: $input) {
|
|
758
753
|
...MarketInfoFields
|
|
@@ -760,7 +755,7 @@ var CREATE_MARKET_INFO_MUTATION = gql10`
|
|
|
760
755
|
}
|
|
761
756
|
${MARKET_INFO}
|
|
762
757
|
`;
|
|
763
|
-
var UPDATE_MARKET_INFO_MUTATION =
|
|
758
|
+
var UPDATE_MARKET_INFO_MUTATION = gql9`
|
|
764
759
|
mutation updateMarketInfo($_id: ID!, $input: MarketInfoInputType!) {
|
|
765
760
|
updateMarketInfo(_id: $_id, input: $input) {
|
|
766
761
|
...MarketInfoFields
|
|
@@ -770,8 +765,8 @@ var UPDATE_MARKET_INFO_MUTATION = gql10`
|
|
|
770
765
|
`;
|
|
771
766
|
|
|
772
767
|
// src/graphql/queries/user.ts
|
|
773
|
-
import { gql as
|
|
774
|
-
var GET_USERS =
|
|
768
|
+
import { gql as gql10 } from "@apollo/client";
|
|
769
|
+
var GET_USERS = gql10`
|
|
775
770
|
query getUsers {
|
|
776
771
|
users {
|
|
777
772
|
...UserFields
|
|
@@ -779,7 +774,7 @@ var GET_USERS = gql11`
|
|
|
779
774
|
}
|
|
780
775
|
${USER_FIELDS_FRAGMENT}
|
|
781
776
|
`;
|
|
782
|
-
var GET_USER =
|
|
777
|
+
var GET_USER = gql10`
|
|
783
778
|
query getUser($_id: ID!) {
|
|
784
779
|
user(_id: $_id) {
|
|
785
780
|
...UserFields
|
|
@@ -787,7 +782,7 @@ var GET_USER = gql11`
|
|
|
787
782
|
}
|
|
788
783
|
${USER_FIELDS_FRAGMENT}
|
|
789
784
|
`;
|
|
790
|
-
var GET_USER_MARKETS =
|
|
785
|
+
var GET_USER_MARKETS = gql10`
|
|
791
786
|
query getUserMarkets {
|
|
792
787
|
userMarkets {
|
|
793
788
|
...MarketFields
|
|
@@ -795,7 +790,7 @@ var GET_USER_MARKETS = gql11`
|
|
|
795
790
|
}
|
|
796
791
|
${MARKET}
|
|
797
792
|
`;
|
|
798
|
-
var GET_USER_STALLHOLDER =
|
|
793
|
+
var GET_USER_STALLHOLDER = gql10`
|
|
799
794
|
query getUserStallholder {
|
|
800
795
|
userStallholder {
|
|
801
796
|
...StallholderFields
|
|
@@ -803,7 +798,7 @@ var GET_USER_STALLHOLDER = gql11`
|
|
|
803
798
|
}
|
|
804
799
|
${STALLHOLDER}
|
|
805
800
|
`;
|
|
806
|
-
var GET_USER_FAVOURITES =
|
|
801
|
+
var GET_USER_FAVOURITES = gql10`
|
|
807
802
|
query getUserFavourites {
|
|
808
803
|
userFavourites {
|
|
809
804
|
markets {
|
|
@@ -965,13 +960,13 @@ var useGetMarketInfo = (marketId) => {
|
|
|
965
960
|
import { useMutation as useMutation6 } from "@apollo/client";
|
|
966
961
|
|
|
967
962
|
// src/graphql/mutations/notification.ts
|
|
968
|
-
import { gql as
|
|
963
|
+
import { gql as gql12 } from "@apollo/client";
|
|
969
964
|
|
|
970
965
|
// src/graphql/queries/notification.ts
|
|
971
|
-
import { gql as
|
|
972
|
-
var USER_NOTIFICATION_FRAGMENT =
|
|
966
|
+
import { gql as gql11 } from "@apollo/client";
|
|
967
|
+
var USER_NOTIFICATION_FRAGMENT = gql11`
|
|
973
968
|
fragment UserNotificationFields on Notification {
|
|
974
|
-
|
|
969
|
+
_id
|
|
975
970
|
userId
|
|
976
971
|
title
|
|
977
972
|
message
|
|
@@ -982,33 +977,15 @@ var USER_NOTIFICATION_FRAGMENT = gql12`
|
|
|
982
977
|
updatedAt
|
|
983
978
|
}
|
|
984
979
|
`;
|
|
985
|
-
var GET_USER_NOTIFICATIONS =
|
|
986
|
-
query getUserNotifications(
|
|
987
|
-
$userId:
|
|
988
|
-
$limit: Int
|
|
989
|
-
$offset: Int
|
|
990
|
-
$isRead: String
|
|
991
|
-
) {
|
|
992
|
-
userNotifications(
|
|
993
|
-
userId: $userId
|
|
994
|
-
limit: $limit
|
|
995
|
-
offset: $offset
|
|
996
|
-
isRead: $isRead
|
|
997
|
-
) {
|
|
998
|
-
...UserNotificationFields
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
${USER_NOTIFICATION_FRAGMENT}
|
|
1002
|
-
`;
|
|
1003
|
-
var GET_UNREAD_NOTIFICATIONS = gql12`
|
|
1004
|
-
query getUnreadNotifications($userId: String!, $limit: Int) {
|
|
1005
|
-
unreadNotifications(userId: $userId, limit: $limit) {
|
|
980
|
+
var GET_USER_NOTIFICATIONS = gql11`
|
|
981
|
+
query getUserNotifications($userId: String!, $limit: Int, $offset: Int) {
|
|
982
|
+
userNotifications(userId: $userId, limit: $limit, offset: $offset) {
|
|
1006
983
|
...UserNotificationFields
|
|
1007
984
|
}
|
|
1008
985
|
}
|
|
1009
986
|
${USER_NOTIFICATION_FRAGMENT}
|
|
1010
987
|
`;
|
|
1011
|
-
var GET_NOTIFICATION_COUNT =
|
|
988
|
+
var GET_NOTIFICATION_COUNT = gql11`
|
|
1012
989
|
query getNotificationCount($userId: String!) {
|
|
1013
990
|
notificationCount(userId: $userId) {
|
|
1014
991
|
total
|
|
@@ -1018,7 +995,7 @@ var GET_NOTIFICATION_COUNT = gql12`
|
|
|
1018
995
|
`;
|
|
1019
996
|
|
|
1020
997
|
// src/graphql/mutations/notification.ts
|
|
1021
|
-
var CREATE_NOTIFICATION =
|
|
998
|
+
var CREATE_NOTIFICATION = gql12`
|
|
1022
999
|
mutation createNotification($input: CreateNotificationInput!) {
|
|
1023
1000
|
createNotification(input: $input) {
|
|
1024
1001
|
...UserNotificationFields
|
|
@@ -1026,7 +1003,7 @@ var CREATE_NOTIFICATION = gql13`
|
|
|
1026
1003
|
}
|
|
1027
1004
|
${USER_NOTIFICATION_FRAGMENT}
|
|
1028
1005
|
`;
|
|
1029
|
-
var CREATE_BULK_NOTIFICATIONS =
|
|
1006
|
+
var CREATE_BULK_NOTIFICATIONS = gql12`
|
|
1030
1007
|
mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
1031
1008
|
createBulkNotifications(input: $input) {
|
|
1032
1009
|
...UserNotificationFields
|
|
@@ -1034,7 +1011,7 @@ var CREATE_BULK_NOTIFICATIONS = gql13`
|
|
|
1034
1011
|
}
|
|
1035
1012
|
${USER_NOTIFICATION_FRAGMENT}
|
|
1036
1013
|
`;
|
|
1037
|
-
var MARK_NOTIFICATION_READ =
|
|
1014
|
+
var MARK_NOTIFICATION_READ = gql12`
|
|
1038
1015
|
mutation markNotificationRead($input: MarkNotificationReadInput!) {
|
|
1039
1016
|
markNotificationRead(input: $input) {
|
|
1040
1017
|
...UserNotificationFields
|
|
@@ -1042,11 +1019,16 @@ var MARK_NOTIFICATION_READ = gql13`
|
|
|
1042
1019
|
}
|
|
1043
1020
|
${USER_NOTIFICATION_FRAGMENT}
|
|
1044
1021
|
`;
|
|
1045
|
-
var MARK_ALL_NOTIFICATIONS_READ =
|
|
1022
|
+
var MARK_ALL_NOTIFICATIONS_READ = gql12`
|
|
1046
1023
|
mutation markAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
|
|
1047
1024
|
markAllNotificationsRead(input: $input)
|
|
1048
1025
|
}
|
|
1049
1026
|
`;
|
|
1027
|
+
var DELETE_NOTIFICATION = gql12`
|
|
1028
|
+
mutation deleteNotification($_id: ID!) {
|
|
1029
|
+
deleteNotification(_id: $_id)
|
|
1030
|
+
}
|
|
1031
|
+
`;
|
|
1050
1032
|
|
|
1051
1033
|
// src/graphql/hooks/notifications/hooksMutation.ts
|
|
1052
1034
|
var useCreateNotification = () => {
|
|
@@ -1061,70 +1043,88 @@ var useCreateBulkNotifications = () => {
|
|
|
1061
1043
|
};
|
|
1062
1044
|
var useMarkNotificationRead = () => {
|
|
1063
1045
|
const [markNotificationRead, { loading, error }] = useMutation6(
|
|
1064
|
-
MARK_NOTIFICATION_READ
|
|
1046
|
+
MARK_NOTIFICATION_READ,
|
|
1047
|
+
{
|
|
1048
|
+
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
1049
|
+
}
|
|
1065
1050
|
);
|
|
1066
1051
|
return { error, loading, markNotificationRead };
|
|
1067
1052
|
};
|
|
1068
1053
|
var useMarkAllNotificationsRead = () => {
|
|
1069
1054
|
const [markAllNotificationsRead, { loading, error }] = useMutation6(
|
|
1070
|
-
MARK_ALL_NOTIFICATIONS_READ
|
|
1055
|
+
MARK_ALL_NOTIFICATIONS_READ,
|
|
1056
|
+
{
|
|
1057
|
+
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
1058
|
+
}
|
|
1071
1059
|
);
|
|
1072
1060
|
return { error, loading, markAllNotificationsRead };
|
|
1073
1061
|
};
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
fetchPolicy: "no-cache",
|
|
1080
|
-
skip: !userId,
|
|
1081
|
-
variables: {
|
|
1082
|
-
isRead,
|
|
1083
|
-
limit: limit ?? 50,
|
|
1084
|
-
offset: offset ?? 0,
|
|
1085
|
-
userId
|
|
1062
|
+
var useDeleteNotification = () => {
|
|
1063
|
+
const [deleteNotification, { loading, error }] = useMutation6(
|
|
1064
|
+
DELETE_NOTIFICATION,
|
|
1065
|
+
{
|
|
1066
|
+
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
1086
1067
|
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
return {
|
|
1090
|
-
error,
|
|
1091
|
-
loading,
|
|
1092
|
-
notifications,
|
|
1093
|
-
refetch
|
|
1094
|
-
};
|
|
1068
|
+
);
|
|
1069
|
+
return { deleteNotification, error, loading };
|
|
1095
1070
|
};
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1071
|
+
|
|
1072
|
+
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
1073
|
+
import { useSubscription as useSubscription2 } from "@apollo/client";
|
|
1074
|
+
|
|
1075
|
+
// src/graphql/subscriptions/notification.ts
|
|
1076
|
+
import { gql as gql13 } from "@apollo/client";
|
|
1077
|
+
var USER_NOTIFICATION_FRAGMENT2 = gql13`
|
|
1078
|
+
fragment UserNotificationFields on Notification {
|
|
1079
|
+
_id
|
|
1080
|
+
userId
|
|
1081
|
+
title
|
|
1082
|
+
message
|
|
1083
|
+
type
|
|
1084
|
+
isRead
|
|
1085
|
+
data
|
|
1086
|
+
createdAt
|
|
1087
|
+
updatedAt
|
|
1088
|
+
}
|
|
1089
|
+
`;
|
|
1090
|
+
var GET_USER_NOTIFICATIONS_SUBSCRIPTION = gql13`
|
|
1091
|
+
subscription getUserNotifications($userId: String!) {
|
|
1092
|
+
getUserNotifications(userId: $userId) {
|
|
1093
|
+
...UserNotificationFields
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
${USER_NOTIFICATION_FRAGMENT2}
|
|
1097
|
+
`;
|
|
1098
|
+
var GET_NOTIFICATION_COUNT_SUBSCRIPTION = gql13`
|
|
1099
|
+
subscription getNotificationCount($userId: String!) {
|
|
1100
|
+
getNotificationCount(userId: $userId) {
|
|
1101
|
+
total
|
|
1102
|
+
unread
|
|
1104
1103
|
}
|
|
1104
|
+
}
|
|
1105
|
+
`;
|
|
1106
|
+
|
|
1107
|
+
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
1108
|
+
var useGetUserNotificationsSubscription = (userId) => {
|
|
1109
|
+
const { data, loading, error } = useSubscription2(GET_USER_NOTIFICATIONS_SUBSCRIPTION, {
|
|
1110
|
+
skip: !userId,
|
|
1111
|
+
variables: { userId }
|
|
1105
1112
|
});
|
|
1106
|
-
const notifications = data?.unreadNotifications;
|
|
1107
1113
|
return {
|
|
1108
1114
|
error,
|
|
1109
1115
|
loading,
|
|
1110
|
-
notifications
|
|
1111
|
-
refetch
|
|
1116
|
+
notifications: data?.getUserNotifications || []
|
|
1112
1117
|
};
|
|
1113
1118
|
};
|
|
1114
|
-
var
|
|
1115
|
-
const { data,
|
|
1116
|
-
fetchPolicy: "no-cache",
|
|
1119
|
+
var useGetNotificationCountSubscription = (userId) => {
|
|
1120
|
+
const { data, loading, error } = useSubscription2(GET_NOTIFICATION_COUNT_SUBSCRIPTION, {
|
|
1117
1121
|
skip: !userId,
|
|
1118
|
-
variables: {
|
|
1119
|
-
userId
|
|
1120
|
-
}
|
|
1122
|
+
variables: { userId }
|
|
1121
1123
|
});
|
|
1122
|
-
const notificationCount = data?.notificationCount;
|
|
1123
1124
|
return {
|
|
1124
1125
|
error,
|
|
1125
1126
|
loading,
|
|
1126
|
-
notificationCount,
|
|
1127
|
-
refetch
|
|
1127
|
+
notificationCount: data?.getNotificationCount || { total: 0, unread: 0 }
|
|
1128
1128
|
};
|
|
1129
1129
|
};
|
|
1130
1130
|
|
|
@@ -1523,9 +1523,9 @@ var useDeleteRelation = () => {
|
|
|
1523
1523
|
};
|
|
1524
1524
|
|
|
1525
1525
|
// src/graphql/hooks/relation/hooksQuery.ts
|
|
1526
|
-
import { useQuery as
|
|
1526
|
+
import { useQuery as useQuery3 } from "@apollo/client";
|
|
1527
1527
|
var useGetRelation = (id) => {
|
|
1528
|
-
const { loading, error, data, refetch } =
|
|
1528
|
+
const { loading, error, data, refetch } = useQuery3(GET_RELATION, {
|
|
1529
1529
|
fetchPolicy: "network-only",
|
|
1530
1530
|
skip: id === "",
|
|
1531
1531
|
variables: { id }
|
|
@@ -1534,7 +1534,7 @@ var useGetRelation = (id) => {
|
|
|
1534
1534
|
return { error, loading, refetch, relation };
|
|
1535
1535
|
};
|
|
1536
1536
|
var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
1537
|
-
const { loading, error, data, refetch } =
|
|
1537
|
+
const { loading, error, data, refetch } = useQuery3(
|
|
1538
1538
|
GET_RELATION_BY_MARKET_AND_STALLHOLDER,
|
|
1539
1539
|
{
|
|
1540
1540
|
fetchPolicy: "network-only",
|
|
@@ -1546,7 +1546,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
|
1546
1546
|
return { error, loading, refetch, relationByMarketAndStallholder };
|
|
1547
1547
|
};
|
|
1548
1548
|
var useGetMarketRelations = (marketId) => {
|
|
1549
|
-
const { loading, error, data, refetch } =
|
|
1549
|
+
const { loading, error, data, refetch } = useQuery3(GET_MARKET_RELATIONS, {
|
|
1550
1550
|
fetchPolicy: "network-only",
|
|
1551
1551
|
skip: marketId === "",
|
|
1552
1552
|
variables: { marketId }
|
|
@@ -1555,7 +1555,7 @@ var useGetMarketRelations = (marketId) => {
|
|
|
1555
1555
|
return { error, loading, marketRelations, refetch };
|
|
1556
1556
|
};
|
|
1557
1557
|
var useGetStallholderRelations = (stallholderId) => {
|
|
1558
|
-
const { loading, error, data, refetch } =
|
|
1558
|
+
const { loading, error, data, refetch } = useQuery3(
|
|
1559
1559
|
GET_STALLHOLDER_RELATIONS,
|
|
1560
1560
|
{
|
|
1561
1561
|
fetchPolicy: "network-only",
|
|
@@ -1567,7 +1567,7 @@ var useGetStallholderRelations = (stallholderId) => {
|
|
|
1567
1567
|
return { error, loading, refetch, stallholderRelations };
|
|
1568
1568
|
};
|
|
1569
1569
|
var useGetResourceConnections = (resourceId, resourceType) => {
|
|
1570
|
-
const { loading, error, data, refetch } =
|
|
1570
|
+
const { loading, error, data, refetch } = useQuery3(GET_RESOURCE_CONNECTIONS, {
|
|
1571
1571
|
fetchPolicy: "network-only",
|
|
1572
1572
|
variables: { resourceId, resourceType }
|
|
1573
1573
|
});
|
|
@@ -1701,9 +1701,9 @@ var useUpdateStallholderInfo = () => {
|
|
|
1701
1701
|
};
|
|
1702
1702
|
|
|
1703
1703
|
// src/graphql/hooks/stallholder/hooksQuery.ts
|
|
1704
|
-
import { useQuery as
|
|
1704
|
+
import { useQuery as useQuery4 } from "@apollo/client";
|
|
1705
1705
|
var useGetStallholders = () => {
|
|
1706
|
-
const { loading, error, data, refetch } =
|
|
1706
|
+
const { loading, error, data, refetch } = useQuery4(GET_STALLHOLDERS, {
|
|
1707
1707
|
fetchPolicy: "network-only"
|
|
1708
1708
|
});
|
|
1709
1709
|
const stallholders = data?.stallholders;
|
|
@@ -1715,7 +1715,7 @@ var useGetStallholders = () => {
|
|
|
1715
1715
|
};
|
|
1716
1716
|
};
|
|
1717
1717
|
var useGetStallholder = (_id) => {
|
|
1718
|
-
const { loading, error, data, refetch } =
|
|
1718
|
+
const { loading, error, data, refetch } = useQuery4(GET_STALLHOLDER, {
|
|
1719
1719
|
fetchPolicy: "network-only",
|
|
1720
1720
|
skip: !_id,
|
|
1721
1721
|
variables: { _id }
|
|
@@ -1724,7 +1724,7 @@ var useGetStallholder = (_id) => {
|
|
|
1724
1724
|
return { error, loading, refetch, stallholder };
|
|
1725
1725
|
};
|
|
1726
1726
|
var useGetStallholdersByRegion = (region) => {
|
|
1727
|
-
const { loading, error, data, refetch } =
|
|
1727
|
+
const { loading, error, data, refetch } = useQuery4(
|
|
1728
1728
|
GET_STALLHOLDERS_BY_REGION,
|
|
1729
1729
|
{
|
|
1730
1730
|
fetchPolicy: "no-cache",
|
|
@@ -1736,7 +1736,7 @@ var useGetStallholdersByRegion = (region) => {
|
|
|
1736
1736
|
return { error, loading, refetch, stallholdersByRegion };
|
|
1737
1737
|
};
|
|
1738
1738
|
var useSearchStallholders = (search, region) => {
|
|
1739
|
-
const { loading, error, data, refetch } =
|
|
1739
|
+
const { loading, error, data, refetch } = useQuery4(SEARCH_STALLHOLDERS, {
|
|
1740
1740
|
fetchPolicy: "network-only",
|
|
1741
1741
|
skip: search.length < 3,
|
|
1742
1742
|
variables: { region, search }
|
|
@@ -1745,7 +1745,7 @@ var useSearchStallholders = (search, region) => {
|
|
|
1745
1745
|
return { error, loading, refetch, stallholderSearch };
|
|
1746
1746
|
};
|
|
1747
1747
|
var useGetStallholderInfo = (stallholderId) => {
|
|
1748
|
-
const { loading, error, data, refetch } =
|
|
1748
|
+
const { loading, error, data, refetch } = useQuery4(GET_STALLHOLDER_INFO, {
|
|
1749
1749
|
fetchPolicy: "network-only",
|
|
1750
1750
|
skip: !stallholderId,
|
|
1751
1751
|
variables: { stallholderId }
|
|
@@ -1851,9 +1851,9 @@ var useDeleteTester = () => {
|
|
|
1851
1851
|
};
|
|
1852
1852
|
|
|
1853
1853
|
// src/graphql/hooks/testers/hooksQuery.ts
|
|
1854
|
-
import { useQuery as
|
|
1854
|
+
import { useQuery as useQuery5 } from "@apollo/client";
|
|
1855
1855
|
var useGetTesters = () => {
|
|
1856
|
-
const { data, loading, error, refetch } =
|
|
1856
|
+
const { data, loading, error, refetch } = useQuery5(GET_TESTERS);
|
|
1857
1857
|
const testers = data?.testers;
|
|
1858
1858
|
return {
|
|
1859
1859
|
error,
|
|
@@ -1863,7 +1863,7 @@ var useGetTesters = () => {
|
|
|
1863
1863
|
};
|
|
1864
1864
|
};
|
|
1865
1865
|
var useGetTester = (_id) => {
|
|
1866
|
-
const { data, loading, error, refetch } =
|
|
1866
|
+
const { data, loading, error, refetch } = useQuery5(GET_TESTER, {
|
|
1867
1867
|
skip: !_id,
|
|
1868
1868
|
variables: { _id }
|
|
1869
1869
|
});
|
|
@@ -1972,37 +1972,37 @@ var useRemoveUserFavouriteResource = () => {
|
|
|
1972
1972
|
};
|
|
1973
1973
|
|
|
1974
1974
|
// src/graphql/hooks/user/hooksQuery.ts
|
|
1975
|
-
import { useQuery as
|
|
1975
|
+
import { useQuery as useQuery6 } from "@apollo/client";
|
|
1976
1976
|
var useGetUsers = () => {
|
|
1977
|
-
const { loading, error, data, refetch } =
|
|
1977
|
+
const { loading, error, data, refetch } = useQuery6(GET_USERS, {
|
|
1978
1978
|
fetchPolicy: "network-only"
|
|
1979
1979
|
});
|
|
1980
1980
|
const users = data?.users;
|
|
1981
1981
|
return { error, loading, refetch, users };
|
|
1982
1982
|
};
|
|
1983
1983
|
var useGetUser = (_id) => {
|
|
1984
|
-
const { loading, error, data, refetch } =
|
|
1984
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER, {
|
|
1985
1985
|
variables: { _id }
|
|
1986
1986
|
});
|
|
1987
1987
|
const user = data?.user;
|
|
1988
1988
|
return { error, loading, refetch, user };
|
|
1989
1989
|
};
|
|
1990
1990
|
var useGetUserMarkets = () => {
|
|
1991
|
-
const { loading, error, data, refetch } =
|
|
1991
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER_MARKETS, {
|
|
1992
1992
|
fetchPolicy: "network-only"
|
|
1993
1993
|
});
|
|
1994
1994
|
const userMarkets = data?.userMarkets;
|
|
1995
1995
|
return { error, loading, refetch, userMarkets };
|
|
1996
1996
|
};
|
|
1997
1997
|
var useGetUserStallholder = () => {
|
|
1998
|
-
const { loading, error, data, refetch } =
|
|
1998
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER_STALLHOLDER, {
|
|
1999
1999
|
fetchPolicy: "network-only"
|
|
2000
2000
|
});
|
|
2001
2001
|
const userStallholder = data?.userStallholder;
|
|
2002
2002
|
return { error, loading, refetch, userStallholder };
|
|
2003
2003
|
};
|
|
2004
2004
|
var useGetUserFavourites = () => {
|
|
2005
|
-
const { loading, error, data, refetch } =
|
|
2005
|
+
const { loading, error, data, refetch } = useQuery6(GET_USER_FAVOURITES, {
|
|
2006
2006
|
fetchPolicy: "network-only"
|
|
2007
2007
|
});
|
|
2008
2008
|
const markets = data?.userFavourites.markets;
|
|
@@ -2014,7 +2014,6 @@ var useGetUserFavourites = () => {
|
|
|
2014
2014
|
return { error, loading, refetch, userFavourites };
|
|
2015
2015
|
};
|
|
2016
2016
|
export {
|
|
2017
|
-
GET_CHAT_MESSAGE,
|
|
2018
2017
|
useAddParticipantToChat,
|
|
2019
2018
|
useAddUserFavouriteResource,
|
|
2020
2019
|
useAdminUpdateResourceType,
|
|
@@ -2033,6 +2032,7 @@ export {
|
|
|
2033
2032
|
useCreateUser,
|
|
2034
2033
|
useDeleteChat,
|
|
2035
2034
|
useDeleteMarket,
|
|
2035
|
+
useDeleteNotification,
|
|
2036
2036
|
useDeleteRelation,
|
|
2037
2037
|
useDeleteStallholder,
|
|
2038
2038
|
useDeleteTester,
|
|
@@ -2045,7 +2045,7 @@ export {
|
|
|
2045
2045
|
useGetMarkets,
|
|
2046
2046
|
useGetMarketsByRegion,
|
|
2047
2047
|
useGetMarketsNearMe,
|
|
2048
|
-
|
|
2048
|
+
useGetNotificationCountSubscription,
|
|
2049
2049
|
useGetRelation,
|
|
2050
2050
|
useGetRelationByMarketAndStallholder,
|
|
2051
2051
|
useGetResourceConnections,
|
|
@@ -2056,12 +2056,11 @@ export {
|
|
|
2056
2056
|
useGetStallholdersByRegion,
|
|
2057
2057
|
useGetTester,
|
|
2058
2058
|
useGetTesters,
|
|
2059
|
-
useGetUnreadNotifications,
|
|
2060
2059
|
useGetUser,
|
|
2061
2060
|
useGetUserChats,
|
|
2062
2061
|
useGetUserFavourites,
|
|
2063
2062
|
useGetUserMarkets,
|
|
2064
|
-
|
|
2063
|
+
useGetUserNotificationsSubscription,
|
|
2065
2064
|
useGetUserStallholder,
|
|
2066
2065
|
useGetUsers,
|
|
2067
2066
|
useLogin,
|