@omniumretail/shared-resources 0.3.72 → 0.3.74
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/bundle.js +1 -1
- package/dist/types/hooks/Anot/get/getNotificationApplicationsQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Anot/get/getNotificationLanguagesQuery.hook.d.ts +6 -0
- package/dist/types/hooks/Anot/mutate/useNotificationTypeQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +3 -2
- package/dist/types/interfaces/Anot.d.ts +6 -0
- package/package.json +1 -1
- package/src/hooks/Anot/get/getNotificationApplicationsQuery.hook.ts +11 -0
- package/src/hooks/Anot/get/getNotificationLanguagesQuery.hook.ts +15 -0
- package/src/hooks/Anot/mutate/{createNotificationTypeQuery.hook.ts → useNotificationTypeQuery.hook.ts} +6 -3
- package/src/hooks/index.ts +3 -2
- package/src/interfaces/Anot.ts +8 -1
- package/src/hooks/Anot/mutate/editNotificationTypeQuery.hook.ts +0 -15
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { NotificationApplication } from "../../../interfaces/Anot";
|
|
3
|
+
export declare const getNotificationApplications: ({ ...options }: UseQueryOptions<NotificationApplication>) => import("@tanstack/react-query").UseQueryResult<NotificationApplication, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
interface SupportedLanguagesResponse {
|
|
3
|
+
SupportedLanguages: string[];
|
|
4
|
+
}
|
|
5
|
+
export declare const getNotificationLanguages: ({ ...options }: UseQueryOptions<SupportedLanguagesResponse>) => import("@tanstack/react-query").UseQueryResult<SupportedLanguagesResponse, unknown>;
|
|
6
|
+
export {};
|
|
@@ -398,9 +398,10 @@ export * from "./ASAEGNG/get/getCustomerHistoryQuery.hook";
|
|
|
398
398
|
export * from "./ASAEGNG/get/getCustomerVouchersQuery.hook";
|
|
399
399
|
export * from "./ASAEGNG/get/getCustomersQuery.hook";
|
|
400
400
|
export * from "./Anot/get/getNotificationsTypeQuery.hook";
|
|
401
|
-
export * from "./Anot/mutate/
|
|
402
|
-
export * from "./Anot/mutate/editNotificationTypeQuery.hook";
|
|
401
|
+
export * from "./Anot/mutate/useNotificationTypeQuery.hook";
|
|
403
402
|
export * from "./Anot/get/getNotificationTypeByIdQuery.hook";
|
|
403
|
+
export * from "./Anot/get/getNotificationApplicationsQuery.hook";
|
|
404
|
+
export * from "./Anot/get/getNotificationLanguagesQuery.hook";
|
|
404
405
|
export * from "./Others/useJobTitlesQuery.hook";
|
|
405
406
|
export * from "./Others/useContractStatesQuery.hook";
|
|
406
407
|
export * from "./Others/useApplicationDataQuery.hook";
|
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
3
|
+
import { NotificationApplication } from "../../../interfaces/Anot";
|
|
4
|
+
|
|
5
|
+
export const getNotificationApplications = ({...options} : UseQueryOptions<NotificationApplication>) => {
|
|
6
|
+
return useQuery(
|
|
7
|
+
['NOTIFICATION_APPLICATIONS', options],
|
|
8
|
+
() => getAuth0<NotificationApplication>(`/AACP/Applications`),
|
|
9
|
+
options
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
3
|
+
|
|
4
|
+
interface SupportedLanguagesResponse {
|
|
5
|
+
SupportedLanguages: string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const getNotificationLanguages = ({...options} : UseQueryOptions<SupportedLanguagesResponse>) => {
|
|
9
|
+
return useQuery(
|
|
10
|
+
['NOTIFICATION_LANGUAGES', options],
|
|
11
|
+
() => getAuth0<SupportedLanguagesResponse>(`/ANOT/Configurations/SupportedLanguages`),
|
|
12
|
+
options
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
-
import { postAuth0 } from '../../../services/ApiService';
|
|
2
|
+
import { postAuth0, putAuth0 } from '../../../services/ApiService';
|
|
3
3
|
import { AnotInterface } from '../../../interfaces/Anot';
|
|
4
4
|
|
|
5
5
|
export const createNotificationTypeQuery = () => {
|
|
6
6
|
const queryClient = useQueryClient();
|
|
7
7
|
return useMutation<AnotInterface, unknown, AnotInterface>((data: AnotInterface) => {
|
|
8
|
-
return
|
|
8
|
+
return data.Id ?
|
|
9
|
+
putAuth0(`/ANOT/NotificationTypes/${data.Id}`, undefined, data)
|
|
10
|
+
:
|
|
11
|
+
postAuth0('/ANOT/NotificationTypes', undefined, data);
|
|
9
12
|
}, {
|
|
10
13
|
onSuccess: (data: AnotInterface) => {
|
|
11
14
|
queryClient.setQueryData(
|
|
12
|
-
['
|
|
15
|
+
['USE_NOTIFICATION_TYPE_QUERY'], data);
|
|
13
16
|
},
|
|
14
17
|
});
|
|
15
18
|
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -467,9 +467,10 @@ export * from "./ASAEGNG/get/getCustomersQuery.hook";
|
|
|
467
467
|
|
|
468
468
|
//ANOT
|
|
469
469
|
export * from "./Anot/get/getNotificationsTypeQuery.hook";
|
|
470
|
-
export * from "./Anot/mutate/
|
|
471
|
-
export * from "./Anot/mutate/editNotificationTypeQuery.hook";
|
|
470
|
+
export * from "./Anot/mutate/useNotificationTypeQuery.hook";
|
|
472
471
|
export * from "./Anot/get/getNotificationTypeByIdQuery.hook";
|
|
472
|
+
export * from "./Anot/get/getNotificationApplicationsQuery.hook";
|
|
473
|
+
export * from "./Anot/get/getNotificationLanguagesQuery.hook";
|
|
473
474
|
|
|
474
475
|
//Others
|
|
475
476
|
export * from "./Others/useJobTitlesQuery.hook";
|
package/src/interfaces/Anot.ts
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
-
import { putAuth0 } from '../../../services/ApiService';
|
|
3
|
-
import { AnotInterface } from '../../../interfaces/Anot';
|
|
4
|
-
|
|
5
|
-
export const editNotificationTypeQuery = () => {
|
|
6
|
-
const queryClient = useQueryClient();
|
|
7
|
-
return useMutation<AnotInterface, unknown, AnotInterface>((data: AnotInterface) => {
|
|
8
|
-
return putAuth0(`/ANOT/NotificationTypes/${data.Id}`, undefined, data);
|
|
9
|
-
}, {
|
|
10
|
-
onSuccess: (data: AnotInterface) => {
|
|
11
|
-
queryClient.setQueryData(
|
|
12
|
-
['EDIT_NOTIFICATION_TYPE_QUERY'], data);
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
}
|