@timardex/cluemart-shared 1.0.60 → 1.0.62
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-CX7VHLIB.mjs → chunk-P6GA67G6.mjs} +4 -7
- package/dist/{chunk-CX7VHLIB.mjs.map → chunk-P6GA67G6.mjs.map} +1 -1
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/formFields/index.mjs +1 -1
- package/dist/{global-BKglpM-a.d.mts → global-CWHCGp1G.d.mts} +2 -0
- package/dist/{global-DYtTgWhw.d.ts → global-D2WubVns.d.ts} +2 -0
- package/dist/graphql/index.cjs +23 -4
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +7 -2
- package/dist/graphql/index.d.ts +7 -2
- package/dist/graphql/index.mjs +22 -4
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +27 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.mjs +25 -10
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.cjs +4 -7
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +3 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -198,6 +198,7 @@ type RelationLog = {
|
|
|
198
198
|
resourceType: EnumResourceType;
|
|
199
199
|
stallType: StallType | null;
|
|
200
200
|
startDate: string;
|
|
201
|
+
startTime: string;
|
|
201
202
|
toStatus: EnumInviteStatus;
|
|
202
203
|
};
|
|
203
204
|
};
|
|
@@ -205,6 +206,7 @@ type RelationDate = {
|
|
|
205
206
|
lastUpdateBy: string;
|
|
206
207
|
stallType: StallType | null;
|
|
207
208
|
startDate: string;
|
|
209
|
+
startTime: string;
|
|
208
210
|
status: EnumInviteStatus;
|
|
209
211
|
};
|
|
210
212
|
interface RelationType {
|
|
@@ -627,7 +629,7 @@ declare const statusOptions: {
|
|
|
627
629
|
* @param dates - The array of date strings to sort.
|
|
628
630
|
* @returns - The sorted array of date strings.
|
|
629
631
|
*/
|
|
630
|
-
declare function
|
|
632
|
+
declare function sortDatesChronologically<T extends {
|
|
631
633
|
startDate: string;
|
|
632
634
|
startTime: string;
|
|
633
635
|
}>(dates: T[]): T[];
|
|
@@ -995,6 +997,11 @@ declare const useUpdateUser: () => {
|
|
|
995
997
|
loading: boolean;
|
|
996
998
|
updateUser: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
997
999
|
};
|
|
1000
|
+
declare const useDeleteUser: () => {
|
|
1001
|
+
deleteUser: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
1002
|
+
error: _apollo_client.ApolloError | undefined;
|
|
1003
|
+
loading: boolean;
|
|
1004
|
+
};
|
|
998
1005
|
declare const useAddUserFavouriteResource: () => {
|
|
999
1006
|
addUserFavouriteResource: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
1000
1007
|
error: _apollo_client.ApolloError | undefined;
|
|
@@ -1154,4 +1161,4 @@ declare const SAVED_TOKEN_KEY = "savedToken";
|
|
|
1154
1161
|
declare const SAVED_REFRESH_TOKEN_KEY = "savedRefreshToken";
|
|
1155
1162
|
declare const USER_STORAGE_KEY = "authUser";
|
|
1156
1163
|
|
|
1157
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderFormData, type CreateStallholderInfoFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallType, type StallholderAttributes, type StallholderFormData, type StallholderInfoFormData, type StallholderInfoType, type StallholderLocation, type StallholderType, type Subcategory, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields,
|
|
1164
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderFormData, type CreateStallholderInfoFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallType, type StallholderAttributes, type StallholderFormData, type StallholderInfoFormData, type StallholderInfoType, type StallholderLocation, type StallholderType, type Subcategory, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, testersFields, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useContactUs, useContactUsForm, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderInfo, useCreateTester, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useDeleteTester, useDeleteUser, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderInfo, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetTester, useGetTesters, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUserStallholder, useGetUsers, useLocationSearch, useLogin, useLoginForm, useLogout, useMarketForm, useMarketInfoForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderForm, useStallholderInfoForm, useTestersForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderInfo, useUpdateTester, useUpdateUser, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, validateVerificationTokenFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -198,6 +198,7 @@ type RelationLog = {
|
|
|
198
198
|
resourceType: EnumResourceType;
|
|
199
199
|
stallType: StallType | null;
|
|
200
200
|
startDate: string;
|
|
201
|
+
startTime: string;
|
|
201
202
|
toStatus: EnumInviteStatus;
|
|
202
203
|
};
|
|
203
204
|
};
|
|
@@ -205,6 +206,7 @@ type RelationDate = {
|
|
|
205
206
|
lastUpdateBy: string;
|
|
206
207
|
stallType: StallType | null;
|
|
207
208
|
startDate: string;
|
|
209
|
+
startTime: string;
|
|
208
210
|
status: EnumInviteStatus;
|
|
209
211
|
};
|
|
210
212
|
interface RelationType {
|
|
@@ -627,7 +629,7 @@ declare const statusOptions: {
|
|
|
627
629
|
* @param dates - The array of date strings to sort.
|
|
628
630
|
* @returns - The sorted array of date strings.
|
|
629
631
|
*/
|
|
630
|
-
declare function
|
|
632
|
+
declare function sortDatesChronologically<T extends {
|
|
631
633
|
startDate: string;
|
|
632
634
|
startTime: string;
|
|
633
635
|
}>(dates: T[]): T[];
|
|
@@ -995,6 +997,11 @@ declare const useUpdateUser: () => {
|
|
|
995
997
|
loading: boolean;
|
|
996
998
|
updateUser: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
997
999
|
};
|
|
1000
|
+
declare const useDeleteUser: () => {
|
|
1001
|
+
deleteUser: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
1002
|
+
error: _apollo_client.ApolloError | undefined;
|
|
1003
|
+
loading: boolean;
|
|
1004
|
+
};
|
|
998
1005
|
declare const useAddUserFavouriteResource: () => {
|
|
999
1006
|
addUserFavouriteResource: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
1000
1007
|
error: _apollo_client.ApolloError | undefined;
|
|
@@ -1154,4 +1161,4 @@ declare const SAVED_TOKEN_KEY = "savedToken";
|
|
|
1154
1161
|
declare const SAVED_REFRESH_TOKEN_KEY = "savedRefreshToken";
|
|
1155
1162
|
declare const USER_STORAGE_KEY = "authUser";
|
|
1156
1163
|
|
|
1157
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderFormData, type CreateStallholderInfoFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallType, type StallholderAttributes, type StallholderFormData, type StallholderInfoFormData, type StallholderInfoType, type StallholderLocation, type StallholderType, type Subcategory, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields,
|
|
1164
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderFormData, type CreateStallholderInfoFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallType, type StallholderAttributes, type StallholderFormData, type StallholderInfoFormData, type StallholderInfoType, type StallholderLocation, type StallholderType, type Subcategory, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, testersFields, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useContactUs, useContactUsForm, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderInfo, useCreateTester, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useDeleteTester, useDeleteUser, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderInfo, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetTester, useGetTesters, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUserStallholder, useGetUsers, useLocationSearch, useLogin, useLoginForm, useLogout, useMarketForm, useMarketInfoForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderForm, useStallholderInfoForm, useTestersForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderInfo, useUpdateTester, useUpdateUser, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, validateVerificationTokenFields };
|
package/dist/index.mjs
CHANGED
|
@@ -182,18 +182,15 @@ var statusOptions = [
|
|
|
182
182
|
})).sort((a, b) => a.label.localeCompare(b.label))
|
|
183
183
|
// Sort the options alphabetically
|
|
184
184
|
];
|
|
185
|
-
function
|
|
185
|
+
function sortDatesChronologically(dates) {
|
|
186
186
|
if (!dates || !dates.length) {
|
|
187
187
|
return [];
|
|
188
188
|
}
|
|
189
|
-
const reference = dayjs();
|
|
190
189
|
return [...dates].sort((a, b) => {
|
|
191
190
|
const dateTimeFormat = `${dateFormat} ${timeFormat}`;
|
|
192
191
|
const dateA = dayjs(`${a.startDate} ${a.startTime}`, dateTimeFormat);
|
|
193
192
|
const dateB = dayjs(`${b.startDate} ${b.startTime}`, dateTimeFormat);
|
|
194
|
-
|
|
195
|
-
const diffB = Math.abs(dateB.diff(reference));
|
|
196
|
-
return diffA - diffB;
|
|
193
|
+
return dateA.valueOf() - dateB.valueOf();
|
|
197
194
|
});
|
|
198
195
|
}
|
|
199
196
|
var availableRegionTypes = Object.values(EnumRegions);
|
|
@@ -2294,6 +2291,7 @@ var RELATION_UPDATE_BY_FRAGMENT = gql10`
|
|
|
2294
2291
|
resourceName
|
|
2295
2292
|
resourceType
|
|
2296
2293
|
startDate
|
|
2294
|
+
startTime
|
|
2297
2295
|
stallType {
|
|
2298
2296
|
label
|
|
2299
2297
|
price
|
|
@@ -2316,6 +2314,7 @@ var RELATION_DATES_FRAGMENT = gql10`
|
|
|
2316
2314
|
fragment RelationDates on RelationDateType {
|
|
2317
2315
|
lastUpdateBy
|
|
2318
2316
|
startDate
|
|
2317
|
+
startTime
|
|
2319
2318
|
stallType {
|
|
2320
2319
|
label
|
|
2321
2320
|
price
|
|
@@ -2761,6 +2760,9 @@ var useCreateStallholderInfo = () => {
|
|
|
2761
2760
|
query: GET_STALLHOLDER_INFO,
|
|
2762
2761
|
variables: { stallholderId }
|
|
2763
2762
|
// Pass the stallholderId for refetching
|
|
2763
|
+
},
|
|
2764
|
+
{
|
|
2765
|
+
query: GET_USER_STALLHOLDER
|
|
2764
2766
|
}
|
|
2765
2767
|
];
|
|
2766
2768
|
}
|
|
@@ -2935,6 +2937,11 @@ var UPDATE_USER_MUTATION = gql15`
|
|
|
2935
2937
|
}
|
|
2936
2938
|
${USER_FIELDS_FRAGMENT}
|
|
2937
2939
|
`;
|
|
2940
|
+
var DELETE_USER_MUTATION = gql15`
|
|
2941
|
+
mutation deleteUser($_id: ID!) {
|
|
2942
|
+
deleteUser(_id: $_id)
|
|
2943
|
+
}
|
|
2944
|
+
`;
|
|
2938
2945
|
var ADD_USER_FAVOURITE_RESOURCE_MUTATION = gql15`
|
|
2939
2946
|
mutation addUserFavouriteResource(
|
|
2940
2947
|
$resourceId: ID!
|
|
@@ -2970,17 +2977,24 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = gql15`
|
|
|
2970
2977
|
|
|
2971
2978
|
// src/graphql/hooks/user/hooksMutation.ts
|
|
2972
2979
|
var useCreateUser = () => {
|
|
2973
|
-
const [createUser, { loading, error }] = useMutation7(CREATE_USER_MUTATION
|
|
2974
|
-
awaitRefetchQueries: true
|
|
2975
|
-
});
|
|
2980
|
+
const [createUser, { loading, error }] = useMutation7(CREATE_USER_MUTATION);
|
|
2976
2981
|
return { createUser, error, loading };
|
|
2977
2982
|
};
|
|
2978
2983
|
var useUpdateUser = () => {
|
|
2979
2984
|
const [updateUser, { loading, error }] = useMutation7(UPDATE_USER_MUTATION, {
|
|
2980
|
-
awaitRefetchQueries: true
|
|
2985
|
+
awaitRefetchQueries: true,
|
|
2986
|
+
refetchQueries: (mutationResult) => {
|
|
2987
|
+
const userId = mutationResult?.data?.updateUser?._id;
|
|
2988
|
+
if (!userId) return [];
|
|
2989
|
+
return [{ query: GET_USER, variables: { _id: userId } }];
|
|
2990
|
+
}
|
|
2981
2991
|
});
|
|
2982
2992
|
return { error, loading, updateUser };
|
|
2983
2993
|
};
|
|
2994
|
+
var useDeleteUser = () => {
|
|
2995
|
+
const [deleteUser, { loading, error }] = useMutation7(DELETE_USER_MUTATION);
|
|
2996
|
+
return { deleteUser, error, loading };
|
|
2997
|
+
};
|
|
2984
2998
|
var useAddUserFavouriteResource = () => {
|
|
2985
2999
|
const [addUserFavouriteResource, { loading, error }] = useMutation7(
|
|
2986
3000
|
ADD_USER_FAVOURITE_RESOURCE_MUTATION,
|
|
@@ -4263,7 +4277,7 @@ export {
|
|
|
4263
4277
|
requirementsOptions,
|
|
4264
4278
|
resetPasswordFields,
|
|
4265
4279
|
socialMediaFields,
|
|
4266
|
-
|
|
4280
|
+
sortDatesChronologically,
|
|
4267
4281
|
stallTypeOptions,
|
|
4268
4282
|
stallholderBasicInfoFields,
|
|
4269
4283
|
stallholderElectricity,
|
|
@@ -4302,6 +4316,7 @@ export {
|
|
|
4302
4316
|
useDeleteRelation,
|
|
4303
4317
|
useDeleteStallholder,
|
|
4304
4318
|
useDeleteTester,
|
|
4319
|
+
useDeleteUser,
|
|
4305
4320
|
useGetChat,
|
|
4306
4321
|
useGetChatSubscription,
|
|
4307
4322
|
useGetMarket,
|