diff --git a/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts index 4395a0ae3ead..5bf84740db81 100644 --- a/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts +++ b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts @@ -20,7 +20,7 @@ describe('copy saved objects', () => { [MockFunction] { "calls": Array [ Array [ - "/api/saved_objects/_copy", + "/api/workspaces/_duplicate_saved_objects", Object { "body": "{\\"objects\\":[{\\"type\\":\\"dashboard\\",\\"id\\":\\"1\\"},{\\"type\\":\\"visualization\\",\\"id\\":\\"2\\"}],\\"includeReferencesDeep\\":true,\\"targetWorkspace\\":\\"1\\"}", }, @@ -40,13 +40,13 @@ describe('copy saved objects', () => { [MockFunction] { "calls": Array [ Array [ - "/api/saved_objects/_copy", + "/api/workspaces/_duplicate_saved_objects", Object { "body": "{\\"objects\\":[{\\"type\\":\\"dashboard\\",\\"id\\":\\"1\\"},{\\"type\\":\\"visualization\\",\\"id\\":\\"2\\"}],\\"includeReferencesDeep\\":true,\\"targetWorkspace\\":\\"1\\"}", }, ], Array [ - "/api/saved_objects/_copy", + "/api/workspaces/_duplicate_saved_objects", Object { "body": "{\\"objects\\":[{\\"type\\":\\"dashboard\\",\\"id\\":\\"1\\"},{\\"type\\":\\"visualization\\",\\"id\\":\\"2\\"}],\\"includeReferencesDeep\\":true,\\"targetWorkspace\\":\\"1\\"}", }, diff --git a/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts index ac7b99e6f3cb..bf7d209bca7a 100644 --- a/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts +++ b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts @@ -11,7 +11,7 @@ export async function duplicateSavedObjects( includeReferencesDeep: boolean = true, targetWorkspace: string ) { - return await http.post('/api/saved_objects/_copy', { + return await http.post('/api/workspaces/_duplicate_saved_objects', { body: JSON.stringify({ objects, includeReferencesDeep, diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx index 260374788adf..dcdfc844f61b 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx @@ -1006,6 +1006,8 @@ describe('SavedObjectsTable', () => { const header = component.find('Header') as any; expect(header.prop('showDuplicateAll')).toEqual(true); header.prop('onDuplicate')(); + + await new Promise((resolve) => process.nextTick(resolve)); component.update(); expect(component.state('isShowingDuplicateModal')).toEqual(true);