@omniumretail/shared-resources 0.3.54 → 0.3.56
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/Astt/mutate/postManualPackageQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Roles/get/useAllRolesQuery.hook.d.ts +2 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Astt/mutate/postManualPackageQuery.hook.ts +18 -0
- package/src/hooks/Roles/get/useAllRolesQuery.hook.ts +14 -12
- package/src/hooks/index.ts +1 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TransferDocumentsDetails } from '../../../interfaces/TransferDocuments';
|
|
2
|
+
export declare const postManualPackageQueryHook: (transferDocumentId: string) => import("@tanstack/react-query").UseMutationResult<TransferDocumentsDetails, unknown, TransferDocumentsDetails, unknown>;
|
|
@@ -6,6 +6,7 @@ interface RolesQueryProps extends UseQueryOptions<ResponseList<"Roles", Roles>>
|
|
|
6
6
|
sortBy: string;
|
|
7
7
|
sortDirection: string;
|
|
8
8
|
tags?: string;
|
|
9
|
+
onlyApplicationRoles?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare const useAllRolesQuery: ({ records, sortBy, sortDirection, tags, page }: RolesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Roles", Roles>, unknown>;
|
|
11
|
+
export declare const useAllRolesQuery: ({ records, sortBy, sortDirection, tags, page, onlyApplicationRoles }: RolesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Roles", Roles>, unknown>;
|
|
11
12
|
export {};
|
|
@@ -137,6 +137,7 @@ export * from "./Astt/get/getBarcodesListingQuery.hook";
|
|
|
137
137
|
export * from "./Astt/get/getBarcodesListingByPackageQuery.hook";
|
|
138
138
|
export * from "./Astt/mutate/postMatchingPackageQuery.hook";
|
|
139
139
|
export * from "./Astt/mutate/postManualTransferQuery.hook";
|
|
140
|
+
export * from "./Astt/mutate/postManualPackageQuery.hook";
|
|
140
141
|
export * from "./Astt/Asgt/get/getTransferDocumentsASTTQuery.hook";
|
|
141
142
|
export * from "./Astt/Asgt/get/getTransferDocumentsByIdASTTQuery.hook";
|
|
142
143
|
export * from "./Astt/Asgt/get/getTransferDocumentsByPackageASTTQuery.hook";
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { TransferDocumentsDetails } from '../../../interfaces/TransferDocuments';
|
|
3
|
+
import { postAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const postManualPackageQueryHook = (transferDocumentId: string) => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<TransferDocumentsDetails, unknown, TransferDocumentsDetails>((data: TransferDocumentsDetails) => {
|
|
8
|
+
return postAuth0(`/ASTT/TransferDocuments/Manual/Packages`, {
|
|
9
|
+
pTransferDocumentId: transferDocumentId
|
|
10
|
+
}, data);
|
|
11
|
+
}, {
|
|
12
|
+
onSuccess: (data: TransferDocumentsDetails) => {
|
|
13
|
+
queryClient.setQueryData(
|
|
14
|
+
['MANUAL_PACKAGE_QUERY'], data);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -8,21 +8,23 @@ interface RolesQueryProps extends UseQueryOptions<ResponseList<"Roles", Roles>>
|
|
|
8
8
|
sortBy: string;
|
|
9
9
|
sortDirection: string;
|
|
10
10
|
tags?: string;
|
|
11
|
+
onlyApplicationRoles?: boolean;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export const useAllRolesQuery = ({ records, sortBy, sortDirection, tags, page }: RolesQueryProps) => {
|
|
14
|
+
export const useAllRolesQuery = ({ records, sortBy, sortDirection, tags, page, onlyApplicationRoles }: RolesQueryProps) => {
|
|
14
15
|
return useQuery(
|
|
15
|
-
['ROLES_QUERY', records, sortBy, sortDirection, tags, page],
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
['ROLES_QUERY', records, sortBy, sortDirection, tags, page, onlyApplicationRoles],
|
|
17
|
+
() => getAuth0<ResponseList<"Roles", Roles>>('/AACP/Roles', {
|
|
18
|
+
pPage: page || 1,
|
|
19
|
+
pRecords: records || 50,
|
|
20
|
+
pSortBy: sortBy,
|
|
21
|
+
pSortDirection: sortDirection,
|
|
22
|
+
pTerms: tags,
|
|
23
|
+
...(onlyApplicationRoles !== undefined ? { pOnlyApplicationRoles: onlyApplicationRoles } : {}),
|
|
24
|
+
}),
|
|
25
|
+
{
|
|
26
|
+
keepPreviousData: true,
|
|
27
|
+
}
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
30
|
|
package/src/hooks/index.ts
CHANGED
|
@@ -160,6 +160,7 @@ export * from "./Astt/get/getBarcodesListingQuery.hook";
|
|
|
160
160
|
export * from "./Astt/get/getBarcodesListingByPackageQuery.hook";
|
|
161
161
|
export * from "./Astt/mutate/postMatchingPackageQuery.hook";
|
|
162
162
|
export * from "./Astt/mutate/postManualTransferQuery.hook";
|
|
163
|
+
export * from "./Astt/mutate/postManualPackageQuery.hook";
|
|
163
164
|
|
|
164
165
|
//Astt Asgt
|
|
165
166
|
export * from "./Astt/Asgt/get/getTransferDocumentsASTTQuery.hook";
|