@timardex/cluemart-shared 1.0.23 → 1.0.25
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-K5NK2CK5.mjs → chunk-GMCWFVU5.mjs} +2 -2
- package/dist/{chunk-L2H5WFGC.mjs → chunk-GMOTXE7A.mjs} +12 -2
- package/dist/chunk-GMOTXE7A.mjs.map +1 -0
- package/dist/enums/index.cjs +11 -0
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +9 -1
- package/dist/enums/index.d.ts +9 -1
- package/dist/enums/index.mjs +3 -1
- package/dist/formFields/index.cjs +43 -0
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +4 -2
- package/dist/formFields/index.d.ts +4 -2
- package/dist/formFields/index.mjs +44 -2
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-BFOVN-Wv.d.ts → global-CKXxsx3Q.d.ts} +10 -13
- package/dist/{global-DDG_c13v.d.mts → global-CbY7duG3.d.mts} +10 -13
- package/dist/graphql/index.cjs +32 -1
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +32 -1
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +30 -26
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +3 -2
- package/dist/hooks/index.d.ts +3 -2
- package/dist/hooks/index.mjs +31 -28
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +116 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +20 -12
- package/dist/index.d.ts +20 -12
- package/dist/index.mjs +113 -27
- 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.map +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-L2H5WFGC.mjs.map +0 -1
- /package/dist/{chunk-K5NK2CK5.mjs.map → chunk-GMCWFVU5.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -74,6 +74,14 @@ declare enum EnumUserRole {
|
|
|
74
74
|
ADMIN = "admin",
|
|
75
75
|
CUSTOMER = "customer"
|
|
76
76
|
}
|
|
77
|
+
declare enum EnumSocialMedia {
|
|
78
|
+
FACEBOOK = "facebook",
|
|
79
|
+
INSTAGRAM = "instagram",
|
|
80
|
+
TIKTOK = "tiktok",
|
|
81
|
+
TWITTER = "twitter",
|
|
82
|
+
WEBSITE = "website",
|
|
83
|
+
YOUTUBE = "youtube"
|
|
84
|
+
}
|
|
77
85
|
|
|
78
86
|
type LoginFormData = {
|
|
79
87
|
email: string;
|
|
@@ -398,6 +406,10 @@ type ResourceImageType = {
|
|
|
398
406
|
source: string;
|
|
399
407
|
title: string;
|
|
400
408
|
};
|
|
409
|
+
type SocialMediaType = {
|
|
410
|
+
name: EnumSocialMedia;
|
|
411
|
+
link: string;
|
|
412
|
+
};
|
|
401
413
|
interface BaseResourceTypeFormData {
|
|
402
414
|
_id?: string;
|
|
403
415
|
active: boolean;
|
|
@@ -411,22 +423,15 @@ interface BaseResourceTypeFormData {
|
|
|
411
423
|
name: string;
|
|
412
424
|
promoCode?: string | null;
|
|
413
425
|
region: string;
|
|
426
|
+
socialMedia?: SocialMediaType[] | null;
|
|
414
427
|
}
|
|
415
|
-
|
|
428
|
+
type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload"> & {
|
|
416
429
|
_id: string;
|
|
417
|
-
active: boolean;
|
|
418
|
-
cover: ResourceImageType;
|
|
419
430
|
createdAt: string;
|
|
420
|
-
description: string;
|
|
421
|
-
images: ResourceImageType[] | null;
|
|
422
|
-
logo: ResourceImageType | null;
|
|
423
|
-
name: string;
|
|
424
431
|
owner: Pick<UserType, "_id" | "email" | "licences">;
|
|
425
|
-
promoCode: string | null;
|
|
426
|
-
region: string;
|
|
427
432
|
relationIds: string[] | null;
|
|
428
433
|
updatedAt: string;
|
|
429
|
-
}
|
|
434
|
+
};
|
|
430
435
|
type LocationType = {
|
|
431
436
|
city: string;
|
|
432
437
|
coordinates: number[];
|
|
@@ -461,7 +466,7 @@ interface FormField {
|
|
|
461
466
|
disabled?: boolean;
|
|
462
467
|
helperText?: string;
|
|
463
468
|
isTextArea?: boolean;
|
|
464
|
-
keyboardType?: "default" | "email-address" | "number-pad";
|
|
469
|
+
keyboardType?: "default" | "email-address" | "number-pad" | "url";
|
|
465
470
|
name: string;
|
|
466
471
|
placeholder: string;
|
|
467
472
|
secureTextEntry?: boolean;
|
|
@@ -650,6 +655,7 @@ declare const defaultMarketFormValues: MarketFormData;
|
|
|
650
655
|
declare const defaultMarketInfoFormValues: MarketInfoFormData;
|
|
651
656
|
declare const defaultStallholderFormValues: StallholderFormData;
|
|
652
657
|
declare const defaultStallholderApplyFormValues: StallholderApplyFormFormData;
|
|
658
|
+
declare function mapBaseResourceTypeToFormData(data: MarketFormData | StallholderFormData): BaseResourceTypeFormData;
|
|
653
659
|
|
|
654
660
|
declare const useLogin: () => {
|
|
655
661
|
error: _apollo_client.ApolloError | undefined;
|
|
@@ -1015,4 +1021,6 @@ declare const profileFields: FormField[];
|
|
|
1015
1021
|
declare const availableCategories: Category[];
|
|
1016
1022
|
declare const categoryColors: Record<string, string>;
|
|
1017
1023
|
|
|
1018
|
-
|
|
1024
|
+
declare const socialMediaFields: FormField[];
|
|
1025
|
+
|
|
1026
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRejectionPolicy, 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 PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, rejectionPolicyOptions, removeTypename, requestPasswordResetFields, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,14 @@ declare enum EnumUserRole {
|
|
|
74
74
|
ADMIN = "admin",
|
|
75
75
|
CUSTOMER = "customer"
|
|
76
76
|
}
|
|
77
|
+
declare enum EnumSocialMedia {
|
|
78
|
+
FACEBOOK = "facebook",
|
|
79
|
+
INSTAGRAM = "instagram",
|
|
80
|
+
TIKTOK = "tiktok",
|
|
81
|
+
TWITTER = "twitter",
|
|
82
|
+
WEBSITE = "website",
|
|
83
|
+
YOUTUBE = "youtube"
|
|
84
|
+
}
|
|
77
85
|
|
|
78
86
|
type LoginFormData = {
|
|
79
87
|
email: string;
|
|
@@ -398,6 +406,10 @@ type ResourceImageType = {
|
|
|
398
406
|
source: string;
|
|
399
407
|
title: string;
|
|
400
408
|
};
|
|
409
|
+
type SocialMediaType = {
|
|
410
|
+
name: EnumSocialMedia;
|
|
411
|
+
link: string;
|
|
412
|
+
};
|
|
401
413
|
interface BaseResourceTypeFormData {
|
|
402
414
|
_id?: string;
|
|
403
415
|
active: boolean;
|
|
@@ -411,22 +423,15 @@ interface BaseResourceTypeFormData {
|
|
|
411
423
|
name: string;
|
|
412
424
|
promoCode?: string | null;
|
|
413
425
|
region: string;
|
|
426
|
+
socialMedia?: SocialMediaType[] | null;
|
|
414
427
|
}
|
|
415
|
-
|
|
428
|
+
type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload"> & {
|
|
416
429
|
_id: string;
|
|
417
|
-
active: boolean;
|
|
418
|
-
cover: ResourceImageType;
|
|
419
430
|
createdAt: string;
|
|
420
|
-
description: string;
|
|
421
|
-
images: ResourceImageType[] | null;
|
|
422
|
-
logo: ResourceImageType | null;
|
|
423
|
-
name: string;
|
|
424
431
|
owner: Pick<UserType, "_id" | "email" | "licences">;
|
|
425
|
-
promoCode: string | null;
|
|
426
|
-
region: string;
|
|
427
432
|
relationIds: string[] | null;
|
|
428
433
|
updatedAt: string;
|
|
429
|
-
}
|
|
434
|
+
};
|
|
430
435
|
type LocationType = {
|
|
431
436
|
city: string;
|
|
432
437
|
coordinates: number[];
|
|
@@ -461,7 +466,7 @@ interface FormField {
|
|
|
461
466
|
disabled?: boolean;
|
|
462
467
|
helperText?: string;
|
|
463
468
|
isTextArea?: boolean;
|
|
464
|
-
keyboardType?: "default" | "email-address" | "number-pad";
|
|
469
|
+
keyboardType?: "default" | "email-address" | "number-pad" | "url";
|
|
465
470
|
name: string;
|
|
466
471
|
placeholder: string;
|
|
467
472
|
secureTextEntry?: boolean;
|
|
@@ -650,6 +655,7 @@ declare const defaultMarketFormValues: MarketFormData;
|
|
|
650
655
|
declare const defaultMarketInfoFormValues: MarketInfoFormData;
|
|
651
656
|
declare const defaultStallholderFormValues: StallholderFormData;
|
|
652
657
|
declare const defaultStallholderApplyFormValues: StallholderApplyFormFormData;
|
|
658
|
+
declare function mapBaseResourceTypeToFormData(data: MarketFormData | StallholderFormData): BaseResourceTypeFormData;
|
|
653
659
|
|
|
654
660
|
declare const useLogin: () => {
|
|
655
661
|
error: _apollo_client.ApolloError | undefined;
|
|
@@ -1015,4 +1021,6 @@ declare const profileFields: FormField[];
|
|
|
1015
1021
|
declare const availableCategories: Category[];
|
|
1016
1022
|
declare const categoryColors: Record<string, string>;
|
|
1017
1023
|
|
|
1018
|
-
|
|
1024
|
+
declare const socialMediaFields: FormField[];
|
|
1025
|
+
|
|
1026
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRejectionPolicy, 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 PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, rejectionPolicyOptions, removeTypename, requestPasswordResetFields, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
|
package/dist/index.mjs
CHANGED
|
@@ -90,6 +90,15 @@ var EnumUserRole = /* @__PURE__ */ ((EnumUserRole2) => {
|
|
|
90
90
|
EnumUserRole2["CUSTOMER"] = "customer";
|
|
91
91
|
return EnumUserRole2;
|
|
92
92
|
})(EnumUserRole || {});
|
|
93
|
+
var EnumSocialMedia = /* @__PURE__ */ ((EnumSocialMedia2) => {
|
|
94
|
+
EnumSocialMedia2["FACEBOOK"] = "facebook";
|
|
95
|
+
EnumSocialMedia2["INSTAGRAM"] = "instagram";
|
|
96
|
+
EnumSocialMedia2["TIKTOK"] = "tiktok";
|
|
97
|
+
EnumSocialMedia2["TWITTER"] = "twitter";
|
|
98
|
+
EnumSocialMedia2["WEBSITE"] = "website";
|
|
99
|
+
EnumSocialMedia2["YOUTUBE"] = "youtube";
|
|
100
|
+
return EnumSocialMedia2;
|
|
101
|
+
})(EnumSocialMedia || {});
|
|
93
102
|
|
|
94
103
|
// src/utils/index.ts
|
|
95
104
|
var dateFormat = "DD-MM-YYYY";
|
|
@@ -556,7 +565,8 @@ var globalDefaultValues = {
|
|
|
556
565
|
logoUpload: null,
|
|
557
566
|
name: "Resource name",
|
|
558
567
|
promoCode: "",
|
|
559
|
-
region: ""
|
|
568
|
+
region: "",
|
|
569
|
+
socialMedia: []
|
|
560
570
|
};
|
|
561
571
|
var defaultMarketFormValues = {
|
|
562
572
|
...globalDefaultValues,
|
|
@@ -639,6 +649,23 @@ var defaultStallholderApplyFormValues = {
|
|
|
639
649
|
stallSize: { depth: 0, width: 0 },
|
|
640
650
|
table: { details: null, isRequired: false }
|
|
641
651
|
};
|
|
652
|
+
function mapBaseResourceTypeToFormData(data) {
|
|
653
|
+
return {
|
|
654
|
+
_id: data._id,
|
|
655
|
+
active: data.active,
|
|
656
|
+
cover: data.cover,
|
|
657
|
+
coverUpload: data.coverUpload,
|
|
658
|
+
description: data.description,
|
|
659
|
+
images: data.images,
|
|
660
|
+
imagesUpload: data.imagesUpload,
|
|
661
|
+
logo: data.logo,
|
|
662
|
+
logoUpload: data.logoUpload,
|
|
663
|
+
name: data.name,
|
|
664
|
+
promoCode: data.promoCode,
|
|
665
|
+
region: data.region,
|
|
666
|
+
socialMedia: data.socialMedia
|
|
667
|
+
};
|
|
668
|
+
}
|
|
642
669
|
|
|
643
670
|
// src/hooks/stallholder/useStallholderForm.ts
|
|
644
671
|
function useStallholderForm(data) {
|
|
@@ -657,22 +684,11 @@ function useStallholderForm(data) {
|
|
|
657
684
|
React.useEffect(() => {
|
|
658
685
|
if (data) {
|
|
659
686
|
reset({
|
|
660
|
-
|
|
661
|
-
active: data.active,
|
|
687
|
+
...mapBaseResourceTypeToFormData(data),
|
|
662
688
|
categories: data.categories,
|
|
663
|
-
cover: data.cover,
|
|
664
|
-
coverUpload: data.coverUpload,
|
|
665
|
-
description: data.description,
|
|
666
|
-
images: data.images,
|
|
667
|
-
imagesUpload: data.imagesUpload,
|
|
668
689
|
locations: data.locations,
|
|
669
|
-
logo: data.logo,
|
|
670
|
-
logoUpload: data.logoUpload,
|
|
671
690
|
multiLocation: data.multiLocation,
|
|
672
|
-
name: data.name,
|
|
673
691
|
products: data.products,
|
|
674
|
-
promoCode: data.promoCode,
|
|
675
|
-
region: data.region,
|
|
676
692
|
specialities: data.specialities
|
|
677
693
|
});
|
|
678
694
|
} else {
|
|
@@ -695,6 +711,7 @@ function useStallholderForm(data) {
|
|
|
695
711
|
name,
|
|
696
712
|
products,
|
|
697
713
|
promoCode,
|
|
714
|
+
socialMedia: socialMedia2,
|
|
698
715
|
region,
|
|
699
716
|
specialities
|
|
700
717
|
} = getValues();
|
|
@@ -717,6 +734,7 @@ function useStallholderForm(data) {
|
|
|
717
734
|
products,
|
|
718
735
|
promoCode,
|
|
719
736
|
region,
|
|
737
|
+
socialMedia: socialMedia2,
|
|
720
738
|
specialities
|
|
721
739
|
},
|
|
722
740
|
formState: { errors },
|
|
@@ -822,21 +840,10 @@ function useMarketForm(data) {
|
|
|
822
840
|
React3.useEffect(() => {
|
|
823
841
|
if (data) {
|
|
824
842
|
reset({
|
|
825
|
-
|
|
826
|
-
active: data.active,
|
|
827
|
-
cover: data.cover,
|
|
828
|
-
coverUpload: data.coverUpload,
|
|
843
|
+
...mapBaseResourceTypeToFormData(data),
|
|
829
844
|
dateTime: data.dateTime,
|
|
830
|
-
description: data.description,
|
|
831
|
-
images: data.images,
|
|
832
|
-
imagesUpload: data.imagesUpload,
|
|
833
845
|
location: data.location,
|
|
834
|
-
logo: data.logo,
|
|
835
|
-
logoUpload: data.logoUpload,
|
|
836
|
-
name: data.name,
|
|
837
|
-
promoCode: data.promoCode,
|
|
838
846
|
provider: data.provider,
|
|
839
|
-
region: data.region,
|
|
840
847
|
tags: data.tags
|
|
841
848
|
});
|
|
842
849
|
} else {
|
|
@@ -858,7 +865,9 @@ function useMarketForm(data) {
|
|
|
858
865
|
name,
|
|
859
866
|
provider,
|
|
860
867
|
region,
|
|
861
|
-
tags
|
|
868
|
+
tags,
|
|
869
|
+
promoCode,
|
|
870
|
+
socialMedia: socialMedia2
|
|
862
871
|
} = getValues();
|
|
863
872
|
return {
|
|
864
873
|
control,
|
|
@@ -875,8 +884,10 @@ function useMarketForm(data) {
|
|
|
875
884
|
logo,
|
|
876
885
|
logoUpload,
|
|
877
886
|
name,
|
|
887
|
+
promoCode,
|
|
878
888
|
provider,
|
|
879
889
|
region,
|
|
890
|
+
socialMedia: socialMedia2,
|
|
880
891
|
tags
|
|
881
892
|
},
|
|
882
893
|
formState: { errors },
|
|
@@ -1228,6 +1239,12 @@ import { gql as gql2 } from "@apollo/client";
|
|
|
1228
1239
|
|
|
1229
1240
|
// src/graphql/queries/global.ts
|
|
1230
1241
|
import { gql } from "@apollo/client";
|
|
1242
|
+
var SOCIAL_MEDIA_FIELDS_FRAGMENT = gql`
|
|
1243
|
+
fragment SocialMediaFields on SocialMediaType {
|
|
1244
|
+
name
|
|
1245
|
+
link
|
|
1246
|
+
}
|
|
1247
|
+
`;
|
|
1231
1248
|
var RESOURCE_IMAGE_FIELDS_FRAGMENT = gql`
|
|
1232
1249
|
fragment ResourceImageFields on ResourceImageType {
|
|
1233
1250
|
source
|
|
@@ -1621,6 +1638,9 @@ var MARKET = gql5`
|
|
|
1621
1638
|
provider
|
|
1622
1639
|
region
|
|
1623
1640
|
relationIds
|
|
1641
|
+
socialMedia {
|
|
1642
|
+
...SocialMediaFields
|
|
1643
|
+
}
|
|
1624
1644
|
tags
|
|
1625
1645
|
updatedAt
|
|
1626
1646
|
}
|
|
@@ -1628,6 +1648,7 @@ var MARKET = gql5`
|
|
|
1628
1648
|
${MARKET_LOCATION_FIELDS_FRAGMENT}
|
|
1629
1649
|
${OWNER_FIELDS_FRAGMENT}
|
|
1630
1650
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
1651
|
+
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
1631
1652
|
`;
|
|
1632
1653
|
var GET_MARKETS = gql5`
|
|
1633
1654
|
query getMarkets {
|
|
@@ -1779,6 +1800,9 @@ var STALLHOLDER = gql7`
|
|
|
1779
1800
|
promoCode
|
|
1780
1801
|
region
|
|
1781
1802
|
relationIds
|
|
1803
|
+
socialMedia {
|
|
1804
|
+
...SocialMediaFields
|
|
1805
|
+
}
|
|
1782
1806
|
specialities
|
|
1783
1807
|
updatedAt
|
|
1784
1808
|
}
|
|
@@ -1787,6 +1811,7 @@ var STALLHOLDER = gql7`
|
|
|
1787
1811
|
${STALLHOLDER_LOCATION_FIELDS_FRAGMENT}
|
|
1788
1812
|
${OWNER_FIELDS_FRAGMENT}
|
|
1789
1813
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
1814
|
+
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
1790
1815
|
`;
|
|
1791
1816
|
var STALLHOLDER_APPLY_FORM = gql7`
|
|
1792
1817
|
fragment StallholderApplyFormFields on StallholderApplyFormType {
|
|
@@ -1941,13 +1966,18 @@ var useCreateMarketInfo = () => {
|
|
|
1941
1966
|
{
|
|
1942
1967
|
awaitRefetchQueries: true,
|
|
1943
1968
|
refetchQueries: (mutationResult) => {
|
|
1944
|
-
const marketId = mutationResult?.data?.createMarketInfo?.
|
|
1969
|
+
const marketId = mutationResult?.data?.createMarketInfo?.marketId;
|
|
1945
1970
|
if (!marketId) return [];
|
|
1946
1971
|
return [
|
|
1947
1972
|
{
|
|
1948
1973
|
query: GET_MARKET_INFO,
|
|
1949
1974
|
variables: { marketId }
|
|
1950
1975
|
// Pass the marketId for refetching
|
|
1976
|
+
},
|
|
1977
|
+
{
|
|
1978
|
+
query: GET_MARKET,
|
|
1979
|
+
variables: { _id: marketId }
|
|
1980
|
+
// Pass the marketId for refetching
|
|
1951
1981
|
}
|
|
1952
1982
|
];
|
|
1953
1983
|
}
|
|
@@ -1968,6 +1998,11 @@ var useUpdateMarketInfo = () => {
|
|
|
1968
1998
|
query: GET_MARKET_INFO,
|
|
1969
1999
|
variables: { marketId }
|
|
1970
2000
|
// Pass the marketId for refetching
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
query: GET_MARKET,
|
|
2004
|
+
variables: { _id: marketId }
|
|
2005
|
+
// Pass the marketId for refetching
|
|
1971
2006
|
}
|
|
1972
2007
|
];
|
|
1973
2008
|
}
|
|
@@ -2181,6 +2216,9 @@ var GET_RESOURCE_CONNECTIONS = gql10`
|
|
|
2181
2216
|
provider
|
|
2182
2217
|
region
|
|
2183
2218
|
relationIds
|
|
2219
|
+
socialMedia {
|
|
2220
|
+
...SocialMediaFields
|
|
2221
|
+
}
|
|
2184
2222
|
tags
|
|
2185
2223
|
updatedAt
|
|
2186
2224
|
relationDates {
|
|
@@ -2224,6 +2262,9 @@ var GET_RESOURCE_CONNECTIONS = gql10`
|
|
|
2224
2262
|
region
|
|
2225
2263
|
relationIds
|
|
2226
2264
|
specialities
|
|
2265
|
+
socialMedia {
|
|
2266
|
+
...SocialMediaFields
|
|
2267
|
+
}
|
|
2227
2268
|
updatedAt
|
|
2228
2269
|
relationDates {
|
|
2229
2270
|
...RelationDates
|
|
@@ -2239,6 +2280,7 @@ var GET_RESOURCE_CONNECTIONS = gql10`
|
|
|
2239
2280
|
${STALLHOLDER_DATETIME_FIELDS_FRAGMENT}
|
|
2240
2281
|
${STALLHOLDER_LOCATION_FIELDS_FRAGMENT}
|
|
2241
2282
|
${RELATION_DATES_FRAGMENT}
|
|
2283
|
+
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
2242
2284
|
`;
|
|
2243
2285
|
|
|
2244
2286
|
// src/graphql/mutations/relation.ts
|
|
@@ -3074,6 +3116,7 @@ var marketInfoPaymentTarget = [
|
|
|
3074
3116
|
},
|
|
3075
3117
|
{
|
|
3076
3118
|
helperText: "Link to payment target *",
|
|
3119
|
+
keyboardType: "url",
|
|
3077
3120
|
name: "paymentTarget.link",
|
|
3078
3121
|
placeholder: "Link to payment target"
|
|
3079
3122
|
}
|
|
@@ -3511,6 +3554,46 @@ var categoryColors = {
|
|
|
3511
3554
|
"home-garden-household": "#006400",
|
|
3512
3555
|
"toys-pets": "#3357FF"
|
|
3513
3556
|
};
|
|
3557
|
+
|
|
3558
|
+
// src/formFields/socialMedia.ts
|
|
3559
|
+
var socialMedia = [
|
|
3560
|
+
{
|
|
3561
|
+
key: "facebook",
|
|
3562
|
+
name: "Facebook",
|
|
3563
|
+
placeholder: "https://www.facebook.com/your-page"
|
|
3564
|
+
},
|
|
3565
|
+
{
|
|
3566
|
+
key: "instagram",
|
|
3567
|
+
name: "Instagram",
|
|
3568
|
+
placeholder: "https://www.instagram.com/your-profile"
|
|
3569
|
+
},
|
|
3570
|
+
{
|
|
3571
|
+
key: "tiktok",
|
|
3572
|
+
name: "TikTok",
|
|
3573
|
+
placeholder: "https://www.tiktok.com/@your-profile"
|
|
3574
|
+
},
|
|
3575
|
+
{
|
|
3576
|
+
key: "twitter",
|
|
3577
|
+
name: "Twitter",
|
|
3578
|
+
placeholder: "https://twitter.com/your-profile"
|
|
3579
|
+
},
|
|
3580
|
+
{
|
|
3581
|
+
key: "website",
|
|
3582
|
+
name: "Website",
|
|
3583
|
+
placeholder: "https://www.yourwebsite.com"
|
|
3584
|
+
},
|
|
3585
|
+
{
|
|
3586
|
+
key: "youtube",
|
|
3587
|
+
name: "YouTube",
|
|
3588
|
+
placeholder: "https://www.youtube.com/channel/your-channel"
|
|
3589
|
+
}
|
|
3590
|
+
];
|
|
3591
|
+
var socialMediaFields = socialMedia.map((link) => ({
|
|
3592
|
+
helperText: link.name,
|
|
3593
|
+
keyboardType: "url",
|
|
3594
|
+
name: link.key,
|
|
3595
|
+
placeholder: link.placeholder
|
|
3596
|
+
}));
|
|
3514
3597
|
export {
|
|
3515
3598
|
EnumInviteStatus,
|
|
3516
3599
|
EnumNotification,
|
|
@@ -3520,6 +3603,7 @@ export {
|
|
|
3520
3603
|
EnumRelationResource,
|
|
3521
3604
|
EnumResourceType,
|
|
3522
3605
|
EnumResourceTypeIcon,
|
|
3606
|
+
EnumSocialMedia,
|
|
3523
3607
|
EnumUserLicence,
|
|
3524
3608
|
EnumUserRole,
|
|
3525
3609
|
ImageTypeEnum,
|
|
@@ -3543,6 +3627,7 @@ export {
|
|
|
3543
3627
|
globalDefaultValues,
|
|
3544
3628
|
loginFields,
|
|
3545
3629
|
mapArrayToOptions,
|
|
3630
|
+
mapBaseResourceTypeToFormData,
|
|
3546
3631
|
marketBasicInfoFields,
|
|
3547
3632
|
marketEndDateFields,
|
|
3548
3633
|
marketInfo,
|
|
@@ -3558,6 +3643,7 @@ export {
|
|
|
3558
3643
|
removeTypename,
|
|
3559
3644
|
requestPasswordResetFields,
|
|
3560
3645
|
resetPasswordFields,
|
|
3646
|
+
socialMediaFields,
|
|
3561
3647
|
sortDatesByProximity,
|
|
3562
3648
|
stallholderBasicInfoFields,
|
|
3563
3649
|
stallholderElectricity,
|