@antscorp/antsomi-ui 2.0.118 → 3.0.0-beta.1
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/es/components/atoms/Alert/Alert.d.ts +1 -1
- package/es/components/atoms/Checkbox/Checkbox.d.ts +1 -1
- package/es/components/atoms/Eyedropper/styled.d.ts +1 -1
- package/es/components/atoms/FloatButton/index.d.ts +6 -1
- package/es/components/atoms/Input/Input.d.ts +1 -0
- package/es/components/atoms/Input/styled.d.ts +2 -0
- package/es/components/atoms/NotificationStatus/NotificationStatus.d.ts +1 -1
- package/es/components/atoms/Popover/Popover.d.ts +1 -1
- package/es/components/atoms/PreviewTabs/styled.d.ts +3 -1
- package/es/components/atoms/Radio/index.d.ts +2 -2
- package/es/components/atoms/Segmented/Segmented.d.ts +1 -1
- package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.js +10 -1
- package/es/components/atoms/Space/Space.d.ts +1 -0
- package/es/components/atoms/Steps/styled.d.ts +3 -1
- package/es/components/atoms/Switch/styled.d.ts +1 -1
- package/es/components/atoms/Tag/Tag.d.ts +3 -2
- package/es/components/molecules/AccessDenied/styled.d.ts +3 -1
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +123 -114
- package/es/components/molecules/AddDynamicContent/styled.d.ts +3 -2
- package/es/components/molecules/ApplyPopupContent/styled.d.ts +3 -1
- package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +5 -3
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +1 -1
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +1 -1
- package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +12 -2
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +1 -1
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +6 -2
- package/es/components/molecules/CalendarSelection/styled.d.ts +1 -1
- package/es/components/molecules/DatePicker/DatePicker.d.ts +73 -7
- package/es/components/molecules/DatePicker/DatePicker.js +7 -6
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +46 -26
- package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +20 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +2 -2
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +2 -0
- package/es/components/molecules/DatePickerV2/index.js +7 -3
- package/es/components/molecules/DisplayFormat/styled.d.ts +2 -1
- package/es/components/molecules/DrawerDetail/DrawerDetail.js +3 -4
- package/es/components/molecules/DrawerDetail/styled.d.ts +3 -1
- package/es/components/molecules/DrawerDetail/types.d.ts +1 -1
- package/es/components/molecules/EditingList/styled.d.ts +6 -2
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +1 -1
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmptyData/styled.d.ts +3 -1
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +26 -8
- package/es/components/molecules/FontSizeInput/styled.d.ts +1 -1
- package/es/components/molecules/ImageEditor/styled.d.ts +3 -1
- package/es/components/molecules/InputSelectAttribute/index.js +2 -2
- package/es/components/molecules/ItemNotFound/styled.d.ts +3 -1
- package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +5 -6
- package/es/components/molecules/MatchAnySelect/styled.d.ts +3 -7
- package/es/components/molecules/Modal/Modal.d.ts +1 -1
- package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
- package/es/components/molecules/PreviewModal/styled.d.ts +3 -1
- package/es/components/molecules/ProcessLoading/styled.d.ts +3 -1
- package/es/components/molecules/RadioGroup/styled.d.ts +1 -1
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +3 -1
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +6 -2
- package/es/components/molecules/SearchPopover/styled.d.ts +1 -0
- package/es/components/molecules/Select/styled.d.ts +3 -1
- package/es/components/molecules/SelectAccount/AccountList.js +2 -2
- package/es/components/molecules/SelectAccount/AccountListOnlyOne.js +2 -2
- package/es/components/molecules/SelectAccount/hook/useGetAbstractUsers.d.ts +2 -2
- package/es/components/molecules/SelectAccount/styled.d.ts +1 -1
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -3
- package/es/components/molecules/ShareAccess/reducer.js +1 -0
- package/es/components/molecules/ShareAccess/types.d.ts +5 -0
- package/es/components/molecules/ShareAccess/utils.js +11 -2
- package/es/components/molecules/Tabs/Tabs.d.ts +1 -1
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +1 -1
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +1 -1
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.d.ts +3 -1
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +2 -2
- package/es/components/molecules/TemplateSaveAs/styled.d.ts +3 -1
- package/es/components/molecules/Tree/Tree.d.ts +2 -4
- package/es/components/molecules/Tree/styled.d.ts +3 -7
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
- package/es/components/molecules/UnsubscribePreview/components/styled.d.ts +6 -3
- package/es/components/molecules/UploadImage/index.js +3 -2
- package/es/components/molecules/VirtualizedMenu/config.js +3 -1
- package/es/components/organism/AccountProfile/components/AccountSetting/styled.d.ts +2 -2
- package/es/components/organism/ActivityTimeline/components/List/styled.d.ts +3 -1
- package/es/components/organism/ActivityTimeline/components/Slide/styled.d.ts +1 -1
- package/es/components/organism/ActivityTimeline/styled.d.ts +6 -2
- package/es/components/organism/AlgorithmsSetting/index.js +3 -3
- package/es/components/organism/AlgorithmsSetting/styled.d.ts +1 -1
- package/es/components/organism/BasicLogin/components/ChooseMethod/styled.d.ts +3 -1
- package/es/components/organism/BasicLogin/components/WidgetLayout/styled.d.ts +3 -1
- package/es/components/organism/BasicLogin/styled.d.ts +9 -6
- package/es/components/organism/ContentSources/Settings.js +40 -41
- package/es/components/organism/DataTable/components/ModifyColumn/styled.d.ts +6 -2
- package/es/components/organism/DataTable/components/Pagination/styled.d.ts +3 -1
- package/es/components/organism/DataTable/components/Table/index.d.ts +1 -1
- package/es/components/organism/DataTable/components/Table/styled.d.ts +2 -2
- package/es/components/organism/DataTable/components/Toolbar/GroupByPopover.d.ts +1 -1
- package/es/components/organism/DataTable/components/Toolbar/styled.d.ts +15 -5
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +7 -5
- package/es/components/organism/DataTable/styled/index.d.ts +6 -2
- package/es/components/organism/DataTable/types/index.d.ts +2 -1
- package/es/components/organism/DataTable/types/toolbar.d.ts +1 -1
- package/es/components/organism/Filter/components/FilterCondition/index.js +1 -1
- package/es/components/organism/Filter/components/FilterCondition/styled.d.ts +3 -1
- package/es/components/organism/Filter/styled.d.ts +12 -4
- package/es/components/organism/FilterSetting/components/common/InputArray/index.js +2 -2
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.d.ts +2 -1
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +4 -4
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.d.ts +0 -1
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +3 -1
- package/es/components/organism/FilterSetting/components/common/TextTreeSelect/index.d.ts +1 -1
- package/es/components/organism/FilterSetting/components/common/TextTreeSelect/index.js +2 -2
- package/es/components/organism/Help/queries/useGetListUser.js +4 -1
- package/es/components/organism/Help/styled.d.ts +3 -4
- package/es/components/organism/LeftMenu/components/HomeMenu/styled.d.ts +4 -2
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +1 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.d.ts +3 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.d.ts +6 -2
- package/es/components/organism/LeftMenu/hooks/usePermission.d.ts +1 -1
- package/es/components/organism/LeftMenu/styled.d.ts +6 -2
- package/es/components/organism/Login/components/ChooseMethod/styled.d.ts +3 -1
- package/es/components/organism/Login/components/VerifyAccount/styled.d.ts +1 -3
- package/es/components/organism/Login/components/WidgetLayout/styled.d.ts +3 -1
- package/es/components/organism/Login/styled.d.ts +9 -6
- package/es/components/organism/ModifyColumnModal/styled.d.ts +6 -2
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.d.ts +3 -1
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +3 -1
- package/es/components/organism/PreviewTemplateModal/styled.d.ts +1 -1
- package/es/components/organism/SQLGeneration/components/styled.d.ts +2 -1
- package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +2 -2
- package/es/components/organism/TextEditor/styled.d.ts +3 -1
- package/es/components/organism/TicketEditor/styled.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useFetchAccountPermission.js +4 -1
- package/es/components/organism/TicketEditorV2/queries/useGetDetailTicket.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListComments.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListUser.js +4 -1
- package/es/components/organism/TicketEditorV2/styled.d.ts +1 -1
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.d.ts +3 -1
- package/es/components/template/Layout/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/components/Empty/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +2 -3
- package/es/components/template/TemplateListing/styled/index.d.ts +3 -1
- package/es/providers/ConfigProvider/ConfigProvider.d.ts +4 -0
- package/es/providers/ConfigProvider/ConfigProvider.js +2 -3
- package/es/providers/ConfigProvider/GlobalStyle.d.ts +2 -2
- package/es/providers/ConfigProvider/GlobalStyle.js +67 -64
- package/es/queries/AI/index.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.js +2 -2
- package/es/queries/Account/useGetAccountList.d.ts +3 -3
- package/es/queries/Account/useGetAccountList.js +2 -1
- package/es/queries/BusinessObject/useGetBODetail.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListAllEvents.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListBO.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListEventAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListPromotionCodeAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListSourceByEvent.d.ts +1 -1
- package/es/queries/CustomFunction/useCustomFunction.d.ts +3 -3
- package/es/queries/CustomFunction/useCustomFunction.js +8 -4
- package/es/queries/DataTable/index.d.ts +25 -25
- package/es/queries/DataTable/index.js +26 -19
- package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.d.ts +1 -1
- package/es/queries/LeftMenu/index.d.ts +9 -9
- package/es/queries/LeftMenu/index.js +4 -6
- package/es/queries/Permission/index.d.ts +2 -2
- package/es/queries/PromotionPool/useGetListPromotionPool.d.ts +1 -1
- package/es/queries/TemplateListing/index.d.ts +5 -5
- package/es/queries/TemplateListing/index.js +28 -14
- package/es/queries/ThirdParty/useGetEventTrackingAttributes.d.ts +1 -1
- package/es/queries/ThirdParty/useGetListFallbackBO.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.js +1 -0
- package/es/queries/Unsubscribe/useGetUnsubscribeList.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeList.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribeListByIdentifier.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribePreferences.d.ts +1 -1
- package/es/queries/User/index.d.ts +1 -1
- package/es/queries/User/index.js +11 -7
- package/es/queries/User/userGetUserInfo.js +6 -3
- package/es/utils/color.d.ts +2 -0
- package/es/utils/color.js +30 -0
- package/package.json +40 -47
|
@@ -2,15 +2,15 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { MediaJsonCustomFunction } from '../../models/CustomFunction';
|
|
3
3
|
import type { APIParams } from '../../components/molecules/AddDynamicContent';
|
|
4
4
|
import type { PayloadInfo } from '../../types';
|
|
5
|
-
export declare const useGetCustomFunction: <T = MediaJsonCustomFunction[]>(apiConfig: APIParams, infos: PayloadInfo, queryOptions?: Omit<UseQueryOptions<MediaJsonCustomFunction[], any, T>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<T
|
|
6
|
-
export declare const useAddSavedCSFunction: () => import("@tanstack/react-query").UseMutationResult<any,
|
|
5
|
+
export declare const useGetCustomFunction: <T = MediaJsonCustomFunction[]>(apiConfig: APIParams, infos: PayloadInfo, queryOptions?: Omit<UseQueryOptions<MediaJsonCustomFunction[], any, T>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<NoInfer<T>, any>;
|
|
6
|
+
export declare const useAddSavedCSFunction: () => import("@tanstack/react-query").UseMutationResult<any, Error, Partial<any> & {
|
|
7
7
|
url: string;
|
|
8
8
|
} & Record<string, any> & {
|
|
9
9
|
infos: PayloadInfo;
|
|
10
10
|
}, {
|
|
11
11
|
previousSavedBlock: unknown;
|
|
12
12
|
}>;
|
|
13
|
-
export declare const useUpdateCSFunction: () => import("@tanstack/react-query").UseMutationResult<any,
|
|
13
|
+
export declare const useUpdateCSFunction: () => import("@tanstack/react-query").UseMutationResult<any, Error, Partial<any> & {
|
|
14
14
|
url: string;
|
|
15
15
|
} & Record<string, any> & {
|
|
16
16
|
infos: PayloadInfo;
|
|
@@ -14,7 +14,8 @@ export const useGetCustomFunction = (apiConfig, infos, queryOptions) => useQuery
|
|
|
14
14
|
});
|
|
15
15
|
export const useAddSavedCSFunction = () => {
|
|
16
16
|
const queryClient = useQueryClient();
|
|
17
|
-
return useMutation(
|
|
17
|
+
return useMutation({
|
|
18
|
+
mutationFn: (payload) => createSavedCustomFunction(payload),
|
|
18
19
|
onMutate: (_payload) => {
|
|
19
20
|
const previousSavedBlock = queryClient.getQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION]);
|
|
20
21
|
return { previousSavedBlock };
|
|
@@ -23,7 +24,8 @@ export const useAddSavedCSFunction = () => {
|
|
|
23
24
|
queryClient.setQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], context?.previousSavedBlock);
|
|
24
25
|
},
|
|
25
26
|
onSettled: () => {
|
|
26
|
-
queryClient.invalidateQueries(
|
|
27
|
+
queryClient.invalidateQueries({
|
|
28
|
+
queryKey: [QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION],
|
|
27
29
|
exact: true,
|
|
28
30
|
});
|
|
29
31
|
},
|
|
@@ -31,7 +33,8 @@ export const useAddSavedCSFunction = () => {
|
|
|
31
33
|
};
|
|
32
34
|
export const useUpdateCSFunction = () => {
|
|
33
35
|
const queryClient = useQueryClient();
|
|
34
|
-
return useMutation(
|
|
36
|
+
return useMutation({
|
|
37
|
+
mutationFn: (payload) => updateSavedCustomFunction(payload),
|
|
35
38
|
onMutate: (_payload) => {
|
|
36
39
|
const previousSavedBlock = queryClient.getQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION]);
|
|
37
40
|
return { previousSavedBlock };
|
|
@@ -40,7 +43,8 @@ export const useUpdateCSFunction = () => {
|
|
|
40
43
|
queryClient.setQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], context?.previousSavedBlock);
|
|
41
44
|
},
|
|
42
45
|
onSettled: () => {
|
|
43
|
-
queryClient.invalidateQueries(
|
|
46
|
+
queryClient.invalidateQueries({
|
|
47
|
+
queryKey: [QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION],
|
|
44
48
|
exact: true,
|
|
45
49
|
});
|
|
46
50
|
},
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from
|
|
2
|
-
import { TCreateModifyColumnArgs, TDeleteModifyColumnArgs, TDeleteSavedFilterArgs, TGetFilterMetricListArgs, TGetMatchesAnyListArgs, TGetMetricListArgs, TGetModifyColumnListArgs, TGetSavedFilterListArgs, TGetSearchListingArgs, TGetTableListingArgs, TSaveFilterArgs, TUpdateFilterArgs, TUpdateModifyColumnArgs } from
|
|
3
|
-
import { ColumnMetric, FilterMetric, ModifyColumn } from
|
|
4
|
-
import { SavedFilter } from
|
|
5
|
-
import { DataTableListing } from
|
|
1
|
+
import { UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TCreateModifyColumnArgs, TDeleteModifyColumnArgs, TDeleteSavedFilterArgs, TGetFilterMetricListArgs, TGetMatchesAnyListArgs, TGetMetricListArgs, TGetModifyColumnListArgs, TGetSavedFilterListArgs, TGetSearchListingArgs, TGetTableListingArgs, TSaveFilterArgs, TUpdateFilterArgs, TUpdateModifyColumnArgs } from "../../services/DataTable";
|
|
3
|
+
import { ColumnMetric, FilterMetric, ModifyColumn } from "../../models/DataTable";
|
|
4
|
+
import { SavedFilter } from "../../models/DataTable/SavedFilter";
|
|
5
|
+
import { DataTableListing } from "../../models/DataTable/DataTableListing";
|
|
6
6
|
export type TGetColumnMetrics = {
|
|
7
7
|
args: TGetMetricListArgs;
|
|
8
|
-
options?: UseQueryOptions<ColumnMetric[], any, ColumnMetric[], any[]>;
|
|
8
|
+
options?: Omit<UseQueryOptions<ColumnMetric[], any, ColumnMetric[], any[]>, "queryKey" | "queryFn">;
|
|
9
9
|
};
|
|
10
10
|
export type TGetModifyColumnList = {
|
|
11
11
|
args: TGetModifyColumnListArgs;
|
|
12
|
-
options?: UseQueryOptions<ModifyColumn[], any, ModifyColumn[], any[]>;
|
|
12
|
+
options?: Omit<UseQueryOptions<ModifyColumn[], any, ModifyColumn[], any[]>, "queryKey" | "queryFn">;
|
|
13
13
|
};
|
|
14
14
|
export type TUpdateModifyColumn = {
|
|
15
|
-
auth: TUpdateModifyColumnArgs[
|
|
15
|
+
auth: TUpdateModifyColumnArgs["auth"];
|
|
16
16
|
options?: UseMutationOptions<{
|
|
17
17
|
status: number;
|
|
18
18
|
}, any, TUpdateModifyColumnArgs, unknown>;
|
|
19
19
|
};
|
|
20
20
|
export type TCreateModifyColumn = {
|
|
21
|
-
auth: TCreateModifyColumnArgs[
|
|
21
|
+
auth: TCreateModifyColumnArgs["auth"];
|
|
22
22
|
options?: UseMutationOptions<{
|
|
23
23
|
status: number;
|
|
24
24
|
}, any, TCreateModifyColumnArgs, unknown>;
|
|
25
25
|
};
|
|
26
26
|
export type TDeleteModifyColumn = {
|
|
27
|
-
auth: TDeleteModifyColumnArgs[
|
|
27
|
+
auth: TDeleteModifyColumnArgs["auth"];
|
|
28
28
|
options?: UseMutationOptions<{
|
|
29
29
|
status: number;
|
|
30
30
|
}, any, TDeleteModifyColumnArgs, unknown>;
|
|
31
31
|
};
|
|
32
32
|
export type TGetSavedFilterList = {
|
|
33
33
|
args: TGetSavedFilterListArgs;
|
|
34
|
-
options?: UseQueryOptions<SavedFilter[], any, SavedFilter[], any[]>;
|
|
34
|
+
options?: Omit<UseQueryOptions<SavedFilter[], any, SavedFilter[], any[]>, "queryKey" | "queryFn">;
|
|
35
35
|
};
|
|
36
36
|
export type TGetFilterMetricList = {
|
|
37
37
|
args: TGetFilterMetricListArgs;
|
|
38
|
-
options?: UseQueryOptions<FilterMetric[], any, FilterMetric[], any[]>;
|
|
38
|
+
options?: Omit<UseQueryOptions<FilterMetric[], any, FilterMetric[], any[]>, "queryKey" | "queryFn">;
|
|
39
39
|
};
|
|
40
40
|
export type TGetMatchesAnyList = {
|
|
41
41
|
args: TGetMatchesAnyListArgs;
|
|
42
|
-
options?: UseQueryOptions<any, any, any, any[]>;
|
|
42
|
+
options?: Omit<UseQueryOptions<any, any, any, any[]>, "queryKey" | "queryFn">;
|
|
43
43
|
};
|
|
44
44
|
export type TGetInfiniteMatchesAnyList = {
|
|
45
45
|
args: TGetMatchesAnyListArgs;
|
|
46
|
-
options?: UseInfiniteQueryOptions<any, any, any, any[]>;
|
|
46
|
+
options?: Omit<UseInfiniteQueryOptions<any, any, any, any[]>, "queryKey" | "queryFn">;
|
|
47
47
|
};
|
|
48
48
|
export type TSaveFilter = {
|
|
49
|
-
auth: TSaveFilterArgs[
|
|
49
|
+
auth: TSaveFilterArgs["auth"];
|
|
50
50
|
options?: UseMutationOptions<{
|
|
51
51
|
status: number;
|
|
52
52
|
}, any, TSaveFilterArgs, any[]>;
|
|
53
53
|
};
|
|
54
54
|
export type TUpdateFilter = {
|
|
55
|
-
auth: TUpdateFilterArgs[
|
|
55
|
+
auth: TUpdateFilterArgs["auth"];
|
|
56
56
|
options?: UseMutationOptions<{
|
|
57
57
|
status: number;
|
|
58
58
|
}, any, TUpdateFilterArgs, any[]>;
|
|
59
59
|
};
|
|
60
60
|
export type TDeleteSavedFilter = {
|
|
61
|
-
auth: TDeleteSavedFilterArgs[
|
|
61
|
+
auth: TDeleteSavedFilterArgs["auth"];
|
|
62
62
|
options?: UseMutationOptions<{
|
|
63
63
|
status: number;
|
|
64
64
|
}, any, TDeleteSavedFilterArgs, unknown>;
|
|
65
65
|
};
|
|
66
66
|
export type TGetTableListing<T = any> = {
|
|
67
67
|
args: TGetTableListingArgs;
|
|
68
|
-
options?: UseQueryOptions<any, any, DataTableListing<T>, any[]>;
|
|
68
|
+
options?: Partial<Pick<UseQueryOptions<any, any, DataTableListing<T>, any[]>, "queryKey">> & Omit<UseQueryOptions<any, any, DataTableListing<T>, any[]>, "queryKey" | "queryFn">;
|
|
69
69
|
};
|
|
70
70
|
export type TGetSearchListing = {
|
|
71
71
|
args: TGetSearchListingArgs;
|
|
72
|
-
options?: UseQueryOptions<any, any, any, any[]>;
|
|
72
|
+
options?: Omit<UseQueryOptions<any, any, any, any[]>, "queryKey" | "queryFn">;
|
|
73
73
|
};
|
|
74
|
-
export declare const useGetColumnMetrics: (params: TGetColumnMetrics) => import("@tanstack/react-query").UseQueryResult<ColumnMetric[]
|
|
75
|
-
export declare const useGetModifyColumnList: (params: TGetModifyColumnList) => import("@tanstack/react-query").UseQueryResult<ModifyColumn[]
|
|
74
|
+
export declare const useGetColumnMetrics: (params: TGetColumnMetrics) => import("@tanstack/react-query").UseQueryResult<NoInfer<ColumnMetric[]>, any>;
|
|
75
|
+
export declare const useGetModifyColumnList: (params: TGetModifyColumnList) => import("@tanstack/react-query").UseQueryResult<NoInfer<ModifyColumn[]>, any>;
|
|
76
76
|
export declare const useUpdateModifyColumn: (params?: TUpdateModifyColumn) => import("@tanstack/react-query").UseMutationResult<{
|
|
77
77
|
status: number;
|
|
78
78
|
}, any, TUpdateModifyColumnArgs, unknown>;
|
|
@@ -82,8 +82,8 @@ export declare const useCreateModifyColumn: (params?: TCreateModifyColumn) => im
|
|
|
82
82
|
export declare const useDeleteModifyColumn: (params?: TDeleteModifyColumn) => import("@tanstack/react-query").UseMutationResult<{
|
|
83
83
|
status: number;
|
|
84
84
|
}, any, TDeleteModifyColumnArgs, unknown>;
|
|
85
|
-
export declare const useGetSavedFilterList: (params: TGetSavedFilterList) => import("@tanstack/react-query").UseQueryResult<SavedFilter[]
|
|
86
|
-
export declare const useGetFilterMetricList: (params: TGetFilterMetricList) => import("@tanstack/react-query").UseQueryResult<FilterMetric[]
|
|
85
|
+
export declare const useGetSavedFilterList: (params: TGetSavedFilterList) => import("@tanstack/react-query").UseQueryResult<NoInfer<SavedFilter[]>, any>;
|
|
86
|
+
export declare const useGetFilterMetricList: (params: TGetFilterMetricList) => import("@tanstack/react-query").UseQueryResult<NoInfer<FilterMetric[]>, any>;
|
|
87
87
|
export declare const useSaveFilter: (params: TSaveFilter) => import("@tanstack/react-query").UseMutationResult<{
|
|
88
88
|
status: number;
|
|
89
89
|
}, any, TSaveFilterArgs, any[]>;
|
|
@@ -93,7 +93,7 @@ export declare const useUpdateFilter: (params: TUpdateFilter) => import("@tansta
|
|
|
93
93
|
export declare const useDeleteSavedFilter: (params?: TDeleteSavedFilter) => import("@tanstack/react-query").UseMutationResult<{
|
|
94
94
|
status: number;
|
|
95
95
|
}, any, TDeleteSavedFilterArgs, unknown>;
|
|
96
|
-
export declare const useGetTableListing: <T>(params: TGetTableListing<T>) => import("@tanstack/react-query").UseQueryResult<DataTableListing<T
|
|
96
|
+
export declare const useGetTableListing: <T>(params: TGetTableListing<T>) => import("@tanstack/react-query").UseQueryResult<NoInfer<DataTableListing<T>>, any>;
|
|
97
97
|
export declare const useGetSearchListing: (params: TGetSearchListing) => import("@tanstack/react-query").UseQueryResult<any, any>;
|
|
98
98
|
export declare const useGetMatchesAnyList: (params: TGetMatchesAnyList) => import("@tanstack/react-query").UseQueryResult<any, any>;
|
|
99
|
-
export declare const useGetInfiniteMatchesAnyList: (params:
|
|
99
|
+
export declare const useGetInfiniteMatchesAnyList: (params: TGetInfiniteMatchesAnyList) => import("@tanstack/react-query").UseInfiniteQueryResult<any, any>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Types
|
|
2
|
-
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from
|
|
3
|
-
import { omit } from
|
|
2
|
+
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from "@tanstack/react-query";
|
|
3
|
+
import { omit } from "lodash";
|
|
4
4
|
// Services
|
|
5
|
-
import { dataTableServices, } from
|
|
5
|
+
import { dataTableServices, } from "../../services/DataTable";
|
|
6
6
|
// Constants
|
|
7
|
-
import { QUERY_KEYS } from
|
|
7
|
+
import { QUERY_KEYS } from "../../constants";
|
|
8
8
|
const { GET_COLUMN_METRICS, GET_MODIFY_COLUMN_LIST, GET_SAVED_FILTER_LIST, GET_FILTER_METRIC_LIST, GET_SEARCH_LIST, GET_MATCHES_ANY_LIST, GET_DATA_TABLE_LISTING, GET_INFINITE_MATCHES_ANY_LIST, } = QUERY_KEYS;
|
|
9
9
|
/* Column */
|
|
10
10
|
export const useGetColumnMetrics = (params) => {
|
|
@@ -39,12 +39,13 @@ export const useUpdateModifyColumn = (params) => {
|
|
|
39
39
|
const { options, auth } = params || {};
|
|
40
40
|
const queryClient = useQueryClient();
|
|
41
41
|
return useMutation({
|
|
42
|
-
mutationFn: variables => dataTableServices.column.updateModifyColumn({
|
|
42
|
+
mutationFn: (variables) => dataTableServices.column.updateModifyColumn({
|
|
43
43
|
auth,
|
|
44
44
|
...variables,
|
|
45
45
|
}),
|
|
46
46
|
onSettled: () => {
|
|
47
|
-
queryClient.invalidateQueries(
|
|
47
|
+
queryClient.invalidateQueries({
|
|
48
|
+
queryKey: [QUERY_KEYS.GET_MODIFY_COLUMN_LIST],
|
|
48
49
|
exact: false,
|
|
49
50
|
});
|
|
50
51
|
},
|
|
@@ -55,12 +56,13 @@ export const useCreateModifyColumn = (params) => {
|
|
|
55
56
|
const { options, auth } = params || {};
|
|
56
57
|
const queryClient = useQueryClient();
|
|
57
58
|
return useMutation({
|
|
58
|
-
mutationFn: variables => dataTableServices.column.createModifyColumn({
|
|
59
|
+
mutationFn: (variables) => dataTableServices.column.createModifyColumn({
|
|
59
60
|
auth,
|
|
60
61
|
...variables,
|
|
61
62
|
}),
|
|
62
63
|
onSettled: () => {
|
|
63
|
-
queryClient.invalidateQueries(
|
|
64
|
+
queryClient.invalidateQueries({
|
|
65
|
+
queryKey: [QUERY_KEYS.GET_MODIFY_COLUMN_LIST],
|
|
64
66
|
exact: false,
|
|
65
67
|
});
|
|
66
68
|
},
|
|
@@ -71,12 +73,13 @@ export const useDeleteModifyColumn = (params) => {
|
|
|
71
73
|
const { options, auth } = params || {};
|
|
72
74
|
const queryClient = useQueryClient();
|
|
73
75
|
return useMutation({
|
|
74
|
-
mutationFn: variables => dataTableServices.column.deleteModifyColumn({
|
|
76
|
+
mutationFn: (variables) => dataTableServices.column.deleteModifyColumn({
|
|
75
77
|
auth,
|
|
76
78
|
...variables,
|
|
77
79
|
}),
|
|
78
80
|
onSettled: () => {
|
|
79
|
-
queryClient.invalidateQueries(
|
|
81
|
+
queryClient.invalidateQueries({
|
|
82
|
+
queryKey: [QUERY_KEYS.GET_MODIFY_COLUMN_LIST],
|
|
80
83
|
exact: false,
|
|
81
84
|
});
|
|
82
85
|
},
|
|
@@ -116,9 +119,10 @@ export const useSaveFilter = (params) => {
|
|
|
116
119
|
const { options, auth } = params || {};
|
|
117
120
|
const queryClient = useQueryClient();
|
|
118
121
|
return useMutation({
|
|
119
|
-
mutationFn: variables => dataTableServices.filter.saveFilter({ auth, ...variables }),
|
|
122
|
+
mutationFn: (variables) => dataTableServices.filter.saveFilter({ auth, ...variables }),
|
|
120
123
|
onSettled: () => {
|
|
121
|
-
queryClient.invalidateQueries(
|
|
124
|
+
queryClient.invalidateQueries({
|
|
125
|
+
queryKey: [QUERY_KEYS.GET_SAVED_FILTER_LIST],
|
|
122
126
|
exact: false,
|
|
123
127
|
});
|
|
124
128
|
},
|
|
@@ -129,9 +133,10 @@ export const useUpdateFilter = (params) => {
|
|
|
129
133
|
const { options, auth } = params || {};
|
|
130
134
|
const queryClient = useQueryClient();
|
|
131
135
|
return useMutation({
|
|
132
|
-
mutationFn: variables => dataTableServices.filter.updateFilter({ auth, ...variables }),
|
|
136
|
+
mutationFn: (variables) => dataTableServices.filter.updateFilter({ auth, ...variables }),
|
|
133
137
|
onSettled: () => {
|
|
134
|
-
queryClient.invalidateQueries(
|
|
138
|
+
queryClient.invalidateQueries({
|
|
139
|
+
queryKey: [QUERY_KEYS.GET_SAVED_FILTER_LIST],
|
|
135
140
|
exact: false,
|
|
136
141
|
});
|
|
137
142
|
},
|
|
@@ -142,12 +147,13 @@ export const useDeleteSavedFilter = (params) => {
|
|
|
142
147
|
const { options, auth } = params || {};
|
|
143
148
|
const queryClient = useQueryClient();
|
|
144
149
|
return useMutation({
|
|
145
|
-
mutationFn: variables => dataTableServices.filter.deleteSavedFilter({
|
|
150
|
+
mutationFn: (variables) => dataTableServices.filter.deleteSavedFilter({
|
|
146
151
|
auth,
|
|
147
152
|
...variables,
|
|
148
153
|
}),
|
|
149
154
|
onSettled: () => {
|
|
150
|
-
queryClient.invalidateQueries(
|
|
155
|
+
queryClient.invalidateQueries({
|
|
156
|
+
queryKey: [QUERY_KEYS.GET_SAVED_FILTER_LIST],
|
|
151
157
|
exact: false,
|
|
152
158
|
});
|
|
153
159
|
},
|
|
@@ -163,7 +169,7 @@ export const useGetTableListing = (params) => {
|
|
|
163
169
|
...args,
|
|
164
170
|
request: { ...args.request, signal },
|
|
165
171
|
}),
|
|
166
|
-
...omit(options,
|
|
172
|
+
...omit(options, "queryKey"),
|
|
167
173
|
});
|
|
168
174
|
};
|
|
169
175
|
export const useGetSearchListing = (params) => {
|
|
@@ -192,12 +198,13 @@ export const useGetInfiniteMatchesAnyList = (params) => {
|
|
|
192
198
|
const { args, options } = params || {};
|
|
193
199
|
return useInfiniteQuery({
|
|
194
200
|
queryKey: [GET_INFINITE_MATCHES_ANY_LIST, args],
|
|
195
|
-
|
|
201
|
+
initialPageParam: 1,
|
|
202
|
+
queryFn: ({ signal, pageParam }) => dataTableServices.filter.getMatchesAnyList({
|
|
196
203
|
...args,
|
|
197
204
|
request: { ...args.request, signal },
|
|
198
205
|
params: {
|
|
199
206
|
...args.params,
|
|
200
|
-
page: pageParam,
|
|
207
|
+
page: pageParam || 1,
|
|
201
208
|
},
|
|
202
209
|
}),
|
|
203
210
|
getNextPageParam: () => undefined,
|
|
@@ -6,5 +6,5 @@ interface TData {
|
|
|
6
6
|
visitor: DynamicContentAttribute['visitor'];
|
|
7
7
|
customer: DynamicContentAttribute['customer'];
|
|
8
8
|
}
|
|
9
|
-
export declare const useGetDynamicContentAttr: <T = TData>(apiConfig: APIParams, infos: PayloadInfo, queryOptions?: Omit<UseQueryOptions<TData, any, T>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<T
|
|
9
|
+
export declare const useGetDynamicContentAttr: <T = TData>(apiConfig: APIParams, infos: PayloadInfo, queryOptions?: Omit<UseQueryOptions<TData, any, T>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<NoInfer<T>, any>;
|
|
10
10
|
export {};
|
|
@@ -3,22 +3,22 @@ import { TFeatureMenuResponse, FeatureMenuPermission, TDestinationChannelRespons
|
|
|
3
3
|
import { TGetDashboardArgs, TGetDestinationChannelArgs, TGetListMenuArgs, TGetListMenuPermissionArgs } from '../../services/LeftMenu';
|
|
4
4
|
export type TGetDashboard = {
|
|
5
5
|
args: TGetDashboardArgs;
|
|
6
|
-
options?: UseQueryOptions<any, any, TDashboardResponse, any[]>;
|
|
6
|
+
options?: Omit<UseQueryOptions<any, any, TDashboardResponse, any[]>, 'queryKey' | 'queryFn'>;
|
|
7
7
|
};
|
|
8
8
|
export type TGetListMenu = {
|
|
9
9
|
args: TGetListMenuArgs;
|
|
10
|
-
options?: UseQueryOptions<any, any, TFeatureMenuResponse, any[]>;
|
|
10
|
+
options?: Omit<UseQueryOptions<any, any, TFeatureMenuResponse, any[]>, 'queryKey' | 'queryFn'>;
|
|
11
11
|
};
|
|
12
12
|
export type TGetListMenuPermission = {
|
|
13
13
|
args: TGetListMenuPermissionArgs;
|
|
14
|
-
options?: UseQueryOptions<any, any, FeatureMenuPermission[], any[]>;
|
|
14
|
+
options?: Omit<UseQueryOptions<any, any, FeatureMenuPermission[], any[]>, 'queryKey' | 'queryFn'>;
|
|
15
15
|
};
|
|
16
16
|
export type TGetDestinationChannel = {
|
|
17
17
|
args: TGetDestinationChannelArgs;
|
|
18
|
-
options?: UseQueryOptions<any, any, TDestinationChannelResponse, any[]>;
|
|
18
|
+
options?: Omit<UseQueryOptions<any, any, TDestinationChannelResponse, any[]>, 'queryKey' | 'queryFn'>;
|
|
19
19
|
};
|
|
20
|
-
export declare const useGetDashboard: (params: TGetDashboard) => import("@tanstack/react-query").UseQueryResult<TDashboardResponse
|
|
21
|
-
export declare const useRemoveDashboard: () => import("@tanstack/react-query").UseMutationResult<any,
|
|
22
|
-
export declare const useGetListMenu: (params: TGetListMenu) => import("@tanstack/react-query").UseQueryResult<TFeatureMenuResponse
|
|
23
|
-
export declare const useGetListMenuPermission: (params: TGetListMenuPermission) => import("@tanstack/react-query").UseQueryResult<FeatureMenuPermission[]
|
|
24
|
-
export declare const useGetDestinationChannel: (params: TGetDestinationChannel) => import("@tanstack/react-query").UseQueryResult<TDestinationChannelResponse
|
|
20
|
+
export declare const useGetDashboard: (params: TGetDashboard) => import("@tanstack/react-query").UseQueryResult<NoInfer<TDashboardResponse>, any>;
|
|
21
|
+
export declare const useRemoveDashboard: () => import("@tanstack/react-query").UseMutationResult<any, Error, import("../../services/LeftMenu").TRemoveDashboardArgs, unknown>;
|
|
22
|
+
export declare const useGetListMenu: (params: TGetListMenu) => import("@tanstack/react-query").UseQueryResult<NoInfer<TFeatureMenuResponse>, any>;
|
|
23
|
+
export declare const useGetListMenuPermission: (params: TGetListMenuPermission) => import("@tanstack/react-query").UseQueryResult<NoInfer<FeatureMenuPermission[]>, any>;
|
|
24
|
+
export declare const useGetDestinationChannel: (params: TGetDestinationChannel) => import("@tanstack/react-query").UseQueryResult<NoInfer<TDestinationChannelResponse>, any>;
|
|
@@ -11,17 +11,18 @@ export const useGetDashboard = (params) => {
|
|
|
11
11
|
return useQuery({
|
|
12
12
|
queryKey: [QUERY_KEYS.GET_DASHBOARD, args.params, args.auth],
|
|
13
13
|
queryFn: () => getDashboard(params.args),
|
|
14
|
-
onSuccess() { },
|
|
15
14
|
...options,
|
|
16
15
|
});
|
|
17
16
|
};
|
|
18
17
|
export const useRemoveDashboard = () => {
|
|
19
18
|
const queryClient = useQueryClient();
|
|
20
|
-
return useMutation(
|
|
19
|
+
return useMutation({
|
|
20
|
+
mutationFn: removeDashboard,
|
|
21
21
|
onSuccess: data => {
|
|
22
22
|
const { code } = data || {};
|
|
23
23
|
if (code === API_RESPONSE_CODE.SUCCESS) {
|
|
24
|
-
queryClient.invalidateQueries(
|
|
24
|
+
queryClient.invalidateQueries({
|
|
25
|
+
queryKey: [QUERY_KEYS.GET_DASHBOARD],
|
|
25
26
|
exact: false,
|
|
26
27
|
});
|
|
27
28
|
}
|
|
@@ -34,7 +35,6 @@ export const useGetListMenu = (params) => {
|
|
|
34
35
|
return useQuery({
|
|
35
36
|
queryKey: [QUERY_KEYS.GET_LIST_MENU, args.params, args.auth],
|
|
36
37
|
queryFn: () => getListMenu(params.args),
|
|
37
|
-
onSuccess() { },
|
|
38
38
|
enabled: !!auth?.token && !!auth.portalId && !!auth?.userId,
|
|
39
39
|
...options,
|
|
40
40
|
});
|
|
@@ -45,7 +45,6 @@ export const useGetListMenuPermission = (params) => {
|
|
|
45
45
|
return useQuery({
|
|
46
46
|
queryKey: [QUERY_KEYS.GET_LIST_MENU_PERMISSION, args.params, token, accountId, userId],
|
|
47
47
|
queryFn: () => getListMenuPermission(params.args),
|
|
48
|
-
onSuccess() { },
|
|
49
48
|
enabled: !!token && !!userId,
|
|
50
49
|
...options,
|
|
51
50
|
});
|
|
@@ -55,7 +54,6 @@ export const useGetDestinationChannel = (params) => {
|
|
|
55
54
|
return useQuery({
|
|
56
55
|
queryKey: [QUERY_KEYS.GET_DESTINATION_CHANNEL, args.params, args.auth],
|
|
57
56
|
queryFn: () => getDestinationChannel(params.args),
|
|
58
|
-
onSuccess() { },
|
|
59
57
|
...options,
|
|
60
58
|
});
|
|
61
59
|
};
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetAccountList } from '../../services/Permission';
|
|
3
3
|
interface GetAccountListProps {
|
|
4
4
|
args: TGetAccountList;
|
|
5
|
-
options?: UseQueryOptions<any, any, any[], any[]>;
|
|
5
|
+
options?: Omit<UseQueryOptions<any, any, any[], any[]>, 'queryKey' | 'queryFn'>;
|
|
6
6
|
}
|
|
7
|
-
export declare const useGetPermissionAccountList: (props: GetAccountListProps) => import("@tanstack/react-query").UseQueryResult<any[]
|
|
7
|
+
export declare const useGetPermissionAccountList: (props: GetAccountListProps) => import("@tanstack/react-query").UseQueryResult<NoInfer<any[]>, any>;
|
|
8
8
|
export {};
|
|
@@ -5,5 +5,5 @@ interface TReturnData {
|
|
|
5
5
|
rows: any[];
|
|
6
6
|
total: number;
|
|
7
7
|
}
|
|
8
|
-
export declare const useGetListPromotionPool: <T = TReturnData>(apiConfig: APIParams, infos: PayloadInfo, queryOptions?: Omit<UseQueryOptions<TReturnData, any, T>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<T
|
|
8
|
+
export declare const useGetListPromotionPool: <T = TReturnData>(apiConfig: APIParams, infos: PayloadInfo, queryOptions?: Omit<UseQueryOptions<TReturnData, any, T>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<NoInfer<T>, any>;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import { TemplateCategory } from '@antscorp/antsomi-ui/es/models/TemplateCategory';
|
|
3
3
|
import { TBulkUpdateObjectTemplateArgs, TGetCategoryListArgs, TGetObjectTemplateDetailArgs, TGetObjectTemplateListArgs, TGetSaveAsGalleryPermissionArgs, TUpdateObjectTemplateArgs, TValidateObjectTemplateNameArgs } from '@antscorp/antsomi-ui/es/services/TemplateListing';
|
|
4
|
-
import { ResponseCheckNameExist
|
|
4
|
+
import { ResponseCheckNameExist } from '../../types';
|
|
5
5
|
import { ObjectTemplate } from '../../models/ObjectTemplate';
|
|
6
6
|
import { TCreateObjectTemplateArgs } from '../../services/TemplateListing';
|
|
7
7
|
export type TGetTemplateCategoryList = {
|
|
@@ -14,7 +14,7 @@ export type TGetSaveAsGalleryPermissionEmails = {
|
|
|
14
14
|
};
|
|
15
15
|
export type TGetObjectTEmplateList = {
|
|
16
16
|
args: TGetObjectTemplateListArgs;
|
|
17
|
-
options?: UseInfiniteQueryOptions<any, any, any,
|
|
17
|
+
options?: UseInfiniteQueryOptions<any, any, any, (string | Record<string, any>)[]>;
|
|
18
18
|
};
|
|
19
19
|
export type TGetObjectTemplateDetail = {
|
|
20
20
|
args: TGetObjectTemplateDetailArgs;
|
|
@@ -38,10 +38,10 @@ export type TUsePersistTemplate = {
|
|
|
38
38
|
params: TUpdateObjectTemplateArgs;
|
|
39
39
|
}, unknown>;
|
|
40
40
|
};
|
|
41
|
-
export declare const useGetTemplateCategoryList: (params: TGetTemplateCategoryList) => import("@tanstack/react-query").UseQueryResult<TemplateCategory[]
|
|
42
|
-
export declare const useGetSaveAsGalleryPermissionEmails: (params: TGetSaveAsGalleryPermissionEmails) => import("@tanstack/react-query").UseQueryResult<string[]
|
|
41
|
+
export declare const useGetTemplateCategoryList: (params: TGetTemplateCategoryList) => import("@tanstack/react-query").UseQueryResult<NoInfer<TemplateCategory[]>, any>;
|
|
42
|
+
export declare const useGetSaveAsGalleryPermissionEmails: (params: TGetSaveAsGalleryPermissionEmails) => import("@tanstack/react-query").UseQueryResult<NoInfer<string[]>, any>;
|
|
43
43
|
export declare const useGetObjectTemplateList: (params: TGetObjectTEmplateList) => import("@tanstack/react-query").UseInfiniteQueryResult<any, any>;
|
|
44
|
-
export declare const useGetObjectTemplateDetail: (params: TGetObjectTemplateDetail) => import("@tanstack/react-query").UseQueryResult<ObjectTemplate
|
|
44
|
+
export declare const useGetObjectTemplateDetail: (params: TGetObjectTemplateDetail) => import("@tanstack/react-query").UseQueryResult<NoInfer<ObjectTemplate>, any>;
|
|
45
45
|
export declare const useValidateTemplateName: (params: TUseValidateTemplateName) => import("@tanstack/react-query").UseMutationResult<ResponseCheckNameExist, any, TValidateObjectTemplateNameArgs, unknown>;
|
|
46
46
|
export declare const useBulkUpdateTemplate: (params: TBulkUpdateTemplate) => import("@tanstack/react-query").UseMutationResult<any, any, TBulkUpdateObjectTemplateArgs, unknown>;
|
|
47
47
|
export declare const useCreateTemplate: (params: TUseCreateTemplate) => import("@tanstack/react-query").UseMutationResult<any, any, TCreateObjectTemplateArgs, unknown>;
|
|
@@ -14,7 +14,6 @@ export const useGetTemplateCategoryList = (params) => {
|
|
|
14
14
|
queryFn: () => args?.params?.publicLevel === PUBLIC_LEVEL.PUBLIC
|
|
15
15
|
? category.getPublicList(params.args)
|
|
16
16
|
: category.getList(params.args),
|
|
17
|
-
onSuccess() { },
|
|
18
17
|
...options,
|
|
19
18
|
});
|
|
20
19
|
};
|
|
@@ -23,7 +22,6 @@ export const useGetSaveAsGalleryPermissionEmails = (params) => {
|
|
|
23
22
|
return useQuery({
|
|
24
23
|
queryKey: [QUERY_KEYS.GET_SAVE_AS_GALLERY_PERMISSION_EMAILS],
|
|
25
24
|
queryFn: () => objectTemplate.getSaveAsGalleryPermission(params.args),
|
|
26
|
-
onSuccess() { },
|
|
27
25
|
...options,
|
|
28
26
|
});
|
|
29
27
|
};
|
|
@@ -31,15 +29,17 @@ export const useGetObjectTemplateList = (params) => {
|
|
|
31
29
|
const { options, args } = params;
|
|
32
30
|
return useInfiniteQuery({
|
|
33
31
|
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST, args.params],
|
|
34
|
-
|
|
32
|
+
initialPageParam: 1,
|
|
33
|
+
queryFn: async ({ pageParam }) => {
|
|
34
|
+
const page = pageParam || 1;
|
|
35
35
|
const res = args?.params?.public_level === PUBLIC_LEVEL.PUBLIC
|
|
36
36
|
? await objectTemplate.getPublicList({
|
|
37
37
|
...args,
|
|
38
|
-
params: { ...args.params, page
|
|
38
|
+
params: { ...args.params, page },
|
|
39
39
|
})
|
|
40
40
|
: await objectTemplate.getList({
|
|
41
41
|
...args,
|
|
42
|
-
params: { ...args.params, page
|
|
42
|
+
params: { ...args.params, page },
|
|
43
43
|
});
|
|
44
44
|
return res;
|
|
45
45
|
},
|
|
@@ -73,10 +73,12 @@ export const useBulkUpdateTemplate = (params) => {
|
|
|
73
73
|
return useMutation({
|
|
74
74
|
mutationFn: objectTemplate.bulkUpdate,
|
|
75
75
|
onSettled() {
|
|
76
|
-
queryClient.invalidateQueries(
|
|
76
|
+
queryClient.invalidateQueries({
|
|
77
|
+
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
77
78
|
exact: false,
|
|
78
79
|
});
|
|
79
|
-
queryClient.invalidateQueries(
|
|
80
|
+
queryClient.invalidateQueries({
|
|
81
|
+
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
80
82
|
exact: false,
|
|
81
83
|
});
|
|
82
84
|
},
|
|
@@ -89,10 +91,12 @@ export const useCreateTemplate = (params) => {
|
|
|
89
91
|
return useMutation({
|
|
90
92
|
mutationFn: objectTemplate.create,
|
|
91
93
|
onSettled() {
|
|
92
|
-
queryClient.invalidateQueries(
|
|
94
|
+
queryClient.invalidateQueries({
|
|
95
|
+
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
93
96
|
exact: false,
|
|
94
97
|
});
|
|
95
|
-
queryClient.invalidateQueries(
|
|
98
|
+
queryClient.invalidateQueries({
|
|
99
|
+
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
96
100
|
exact: false,
|
|
97
101
|
});
|
|
98
102
|
},
|
|
@@ -105,10 +109,12 @@ export const useUpdateTemplate = (params) => {
|
|
|
105
109
|
return useMutation({
|
|
106
110
|
mutationFn: objectTemplate.update,
|
|
107
111
|
onSettled() {
|
|
108
|
-
queryClient.invalidateQueries(
|
|
112
|
+
queryClient.invalidateQueries({
|
|
113
|
+
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
109
114
|
exact: false,
|
|
110
115
|
});
|
|
111
|
-
queryClient.invalidateQueries(
|
|
116
|
+
queryClient.invalidateQueries({
|
|
117
|
+
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
112
118
|
exact: false,
|
|
113
119
|
});
|
|
114
120
|
},
|
|
@@ -130,11 +136,19 @@ export const usePersistTemplate = (params) => {
|
|
|
130
136
|
}
|
|
131
137
|
},
|
|
132
138
|
onSettled(data, error, variables) {
|
|
133
|
-
queryClient.invalidateQueries(
|
|
134
|
-
|
|
139
|
+
queryClient.invalidateQueries({
|
|
140
|
+
queryKey: [
|
|
141
|
+
QUERY_KEYS.GET_OBJECT_TEMPLATE_DETAIL,
|
|
142
|
+
+get(variables, 'params.data.template_id', -1),
|
|
143
|
+
],
|
|
144
|
+
exact: true,
|
|
145
|
+
});
|
|
146
|
+
queryClient.invalidateQueries({
|
|
147
|
+
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
135
148
|
exact: false,
|
|
136
149
|
});
|
|
137
|
-
queryClient.invalidateQueries(
|
|
150
|
+
queryClient.invalidateQueries({
|
|
151
|
+
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
138
152
|
exact: false,
|
|
139
153
|
});
|
|
140
154
|
},
|
|
@@ -10,5 +10,5 @@ type GetDataTableBOProps<T> = {
|
|
|
10
10
|
eventActionId: number;
|
|
11
11
|
options?: Omit<UseQueryOptions<any, any, T, any[]>, OptionHasDefault>;
|
|
12
12
|
};
|
|
13
|
-
export declare const useGetEventTrackingAttributes: <T = EventTrackingAttribute>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<T
|
|
13
|
+
export declare const useGetEventTrackingAttributes: <T = EventTrackingAttribute>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<NoInfer<T>, any>;
|
|
14
14
|
export {};
|
|
@@ -6,5 +6,5 @@ type GetDataTableBOProps<T> = {
|
|
|
6
6
|
serviceAuth: TServiceAuth;
|
|
7
7
|
options?: Omit<UseQueryOptions<any, any, T, any[]>, OptionHasDefault>;
|
|
8
8
|
};
|
|
9
|
-
export declare const useGetListFallbackBO: <T = FallbackBO[]>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<T
|
|
9
|
+
export declare const useGetListFallbackBO: <T = FallbackBO[]>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<NoInfer<T>, any>;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStoreSavedMedia: (domain: string, slug: string, infos: any) => import("@tanstack/react-query").UseInfiniteQueryResult<import("../../models/SavedMedia").SavedMedia[], unknown>;
|
|
1
|
+
export declare const useStoreSavedMedia: (domain: string, slug: string, infos: any) => import("@tanstack/react-query").UseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<import("../../models/SavedMedia").SavedMedia[], unknown>, Error>;
|
|
@@ -7,6 +7,7 @@ import { QUERY_KEYS } from '../../constants';
|
|
|
7
7
|
// Hook to fetch data with infinite scrolling
|
|
8
8
|
export const useStoreSavedMedia = (domain, slug, infos) => useInfiniteQuery({
|
|
9
9
|
queryKey: [QUERY_KEYS.GET_LIST_SAVED_MEDIA, domain, slug, infos],
|
|
10
|
+
initialPageParam: 1,
|
|
10
11
|
queryFn: ({ pageParam }) => getListingSavedMedia(domain, slug, infos, pageParam),
|
|
11
12
|
getNextPageParam: (lastPage, pages) => (lastPage.length >= 10 ? pages.length + 1 : undefined),
|
|
12
13
|
});
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListProps {
|
|
4
4
|
args: TGetUnsubscribeListArgs;
|
|
5
|
-
options?: UseQueryOptions<any, Error, any>;
|
|
5
|
+
options?: Omit<UseQueryOptions<any, Error, any>, 'queryKey' | 'queryFn'>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeList: ({ args, options }: UseGetUnsubscribeListProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|
|
@@ -7,8 +7,8 @@ import { unsubscribeServices, } from '../../services/Unsubscribe';
|
|
|
7
7
|
import { QUERY_KEYS } from '../../constants';
|
|
8
8
|
export const useGetUnsubscribeList = ({ args, options }, infos) => useQuery({
|
|
9
9
|
queryKey: [QUERY_KEYS.GET_UNSUBSCRIBE_LIST, args, options, infos],
|
|
10
|
-
queryFn: async () =>
|
|
11
|
-
|
|
10
|
+
queryFn: async () => {
|
|
11
|
+
const data = await unsubscribeServices.getUnsubscribeList(args, infos);
|
|
12
12
|
if (!data)
|
|
13
13
|
return [];
|
|
14
14
|
const unsubscribedList = data?.entries[0] || [];
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListByIdentifierArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListByIdentifierProps {
|
|
4
4
|
args: TGetUnsubscribeListByIdentifierArgs;
|
|
5
|
-
options?: UseQueryOptions<any, Error, any>;
|
|
5
|
+
options?: Omit<UseQueryOptions<any, Error, any>, 'queryKey' | 'queryFn'>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeListByIdentifier: ({ args, options }: UseGetUnsubscribeListByIdentifierProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListPermissionArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListPermissionProps {
|
|
4
4
|
args: TGetUnsubscribeListPermissionArgs;
|
|
5
|
-
options?: UseQueryOptions<any, Error, any>;
|
|
5
|
+
options?: Omit<UseQueryOptions<any, Error, any>, 'queryKey' | 'queryFn'>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeListPermission: ({ args, options }: UseGetUnsubscribeListPermissionProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|