Skip to content

Commit

Permalink
UIQM-571 Wait for PUT request to finish after deriving before redirec…
Browse files Browse the repository at this point in the history
…ting to Inventory
  • Loading branch information
BogdanDenis committed Oct 31, 2023
1 parent da3e996 commit 540fd59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/QuickMarcEditor/QuickMarcDeriveWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ const QuickMarcDeriveWrapper = ({

return mutator.quickMarcEditMarcRecord.POST(formValuesForDerive)
.then(async ({ qmRecordId }) => {
onClose('id'); // https://issues.folio.org/browse/UIQM-82

try {
const { externalId } = await getQuickMarcRecordStatus({
quickMarcRecordStatusGETRequest: mutator.quickMarcRecordStatus.GET,
Expand Down
4 changes: 2 additions & 2 deletions src/QuickMarcEditor/QuickMarcDeriveWrapper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ describe('Given QuickMarcDeriveWrapper', () => {
});

describe('when click on save button', () => {
it('should show on save message and redirect on load page', async () => {
it('should show on save message and not redirect until PUT request has finished', async () => {
let getByText;

await act(async () => {
Expand All @@ -350,7 +350,7 @@ describe('Given QuickMarcDeriveWrapper', () => {

expect(mockShowCallout).toHaveBeenCalledWith({ messageId: 'ui-quick-marc.record.saveNew.onSave' });

expect(mockOnClose).toHaveBeenCalledWith('id');
expect(mockOnClose).not.toHaveBeenCalled();
});

describe('when there is an error during POST request', () => {
Expand Down

0 comments on commit 540fd59

Please sign in to comment.