Skip to content

Commit

Permalink
UIIN-2614 Provide an instance tenantId to the PO line form when creat…
Browse files Browse the repository at this point in the history
…ing an order from the instance
  • Loading branch information
usavkov-epam committed Oct 11, 2023
1 parent afc506a commit ba6b0db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
* Consortial Central Tenant: Handling Holdings and Item actions on the Instance detail view. Refs UIIN-2523.
* Hide Held by facet in Inventory contributor and subject browse. Refs UIIN-2591.
* Use `==` for exact phrase search in Advanced Search for all full-text and term fields. Refs UIIN-2612.
* Provide an instance `tenantId` to the PO line form when creating an order from the instance. Refs UIIN-2614.

## [9.4.12](https://github.com/folio-org/ui-inventory/tree/v9.4.12) (2023-09-21)
[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v9.4.11...v9.4.12)
Expand Down
13 changes: 10 additions & 3 deletions src/components/NewOrderModal/NewOrderModalContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import {
useParams,
} from 'react-router-dom';

import { useOkapiKy } from '@folio/stripes/core';
import {
useOkapiKy,
useStripes,
} from '@folio/stripes/core';

import { useInstance } from '../../common';
import { ORDERS_API } from '../../constants';
import NewOrderModal from './NewOrderModal';

Expand All @@ -20,7 +24,9 @@ const NewOrderModalContainer = ({
}) => {
const history = useHistory();
const ky = useOkapiKy();
const stripes = useStripes();
const { id } = useParams();
const { instance } = useInstance(id);
const [orderId, setOrderId] = useState();

const validatePONumber = useCallback(async (poNumber) => {
Expand All @@ -45,9 +51,10 @@ const NewOrderModalContainer = ({

const onSubmit = useCallback(() => {
const route = orderId ? `/orders/view/${orderId}/po-line/create` : '/orders/create';
const instanceTenantId = instance?.tenantId || stripes.okapi.tenant;

history.push(route, { instanceId: id });
}, [orderId]);
history.push(route, { instanceId: id, instanceTenantId });
}, [instance, orderId, stripes.okapi.tenant]);

return (
<NewOrderModal
Expand Down

0 comments on commit ba6b0db

Please sign in to comment.