@openmrs/esm-stock-management-app 1.0.1-pre.350 → 1.0.1-pre.357
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/304.js +2 -0
- package/dist/304.js.map +1 -0
- package/dist/969.js +1 -0
- package/dist/969.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +41 -41
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/stock-batch/stock-batch.resource.ts +7 -5
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules.resource.ts +7 -5
- package/src/stock-items/stock-items.resource.ts +23 -19
- package/src/stock-items/types.ts +79 -0
- package/src/stock-locations/add-locations-form.component.tsx +74 -0
- package/src/stock-locations/location-admin-form.component.tsx +164 -0
- package/src/stock-locations/stock-locations-table.component.tsx +33 -10
- package/src/stock-locations/stock-locations-table.resource.tsx +67 -12
- package/src/stock-locations/stock-locations-table.scss +3 -0
- package/src/stock-lookups/stock-lookups.resource.ts +15 -15
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +10 -5
- package/src/stock-operations/stock-operations.resource.ts +18 -14
- package/src/stock-sources/stock-sources.resource.ts +5 -5
- package/src/stock-user-role-scopes/stock-user-role-scopes.resource.ts +5 -5
- package/dist/500.js +0 -2
- package/dist/500.js.map +0 -1
- package/dist/842.js +0 -1
- package/dist/842.js.map +0 -1
- /package/dist/{500.js.LICENSE.txt → 304.js.LICENSE.txt} +0 -0
@@ -2,13 +2,13 @@ import useSWR from "swr";
|
|
2
2
|
import { ResourceFilterCriteria, toQueryParams } from "../core/api/api";
|
3
3
|
import { PageableResult } from "../core/api/types/PageableResult";
|
4
4
|
import { UserRoleScope } from "../core/api/types/identity/UserRoleScope";
|
5
|
-
import { openmrsFetch } from "@openmrs/esm-framework";
|
5
|
+
import { openmrsFetch, restBaseUrl } from "@openmrs/esm-framework";
|
6
6
|
|
7
7
|
export type UserRoleScopeFilter = ResourceFilterCriteria;
|
8
8
|
|
9
9
|
// getUserRoleScopes
|
10
10
|
export function useUserRoleScopes(filter: UserRoleScopeFilter) {
|
11
|
-
const apiUrl =
|
11
|
+
const apiUrl = `${restBaseUrl}/stockmanagement/userrolescope${toQueryParams(
|
12
12
|
filter
|
13
13
|
)}`;
|
14
14
|
const { data, error, isLoading } = useSWR<
|
@@ -24,7 +24,7 @@ export function useUserRoleScopes(filter: UserRoleScopeFilter) {
|
|
24
24
|
|
25
25
|
// getUserRoleScope
|
26
26
|
export function useUserRoleScope(id: string) {
|
27
|
-
const apiUrl =
|
27
|
+
const apiUrl = `${restBaseUrl}/stockmanagement/userrolescope/${id}`;
|
28
28
|
const { data, error, isLoading } = useSWR<{ data: UserRoleScope }, Error>(
|
29
29
|
apiUrl,
|
30
30
|
openmrsFetch
|
@@ -46,7 +46,7 @@ export function deleteUserRoleScopes(ids: string[]) {
|
|
46
46
|
if (otherIds.length > 0) {
|
47
47
|
otherIds = "?ids=" + otherIds;
|
48
48
|
}
|
49
|
-
const apiUrl =
|
49
|
+
const apiUrl = `${restBaseUrl}/stockmanagement/userrolescope/${ids[0]}${otherIds}`;
|
50
50
|
const abortController = new AbortController();
|
51
51
|
|
52
52
|
return openmrsFetch(apiUrl, {
|
@@ -62,7 +62,7 @@ export function deleteUserRoleScopes(ids: string[]) {
|
|
62
62
|
export function createOrUpdateUserRoleScope(item: UserRoleScope) {
|
63
63
|
const abortController = new AbortController();
|
64
64
|
const isNew = item.uuid != null;
|
65
|
-
const apiUrl =
|
65
|
+
const apiUrl = `${restBaseUrl}/stockmanagement/userrolescope${
|
66
66
|
isNew ? "/" + item.uuid : ""
|
67
67
|
}`;
|
68
68
|
return openmrsFetch(apiUrl, {
|