Skip to content

Commit

Permalink
Merge pull request #1 from SuZhou-Joe/saved-objects-pr
Browse files Browse the repository at this point in the history
feat: update snapshot
  • Loading branch information
gaobinlong authored Sep 22, 2023
2 parents 50333a0 + d1719f1 commit 42b744a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ describe('getSortedObjectsForExport()', () => {
index-pattern,
search,
],
workspaces: undefined,
},
],
],
Expand Down Expand Up @@ -219,7 +218,6 @@ describe('getSortedObjectsForExport()', () => {
index-pattern,
search,
],
workspaces: undefined,
},
],
],
Expand Down Expand Up @@ -370,7 +368,6 @@ describe('getSortedObjectsForExport()', () => {
index-pattern,
search,
],
workspaces: undefined,
},
],
],
Expand Down Expand Up @@ -462,7 +459,6 @@ describe('getSortedObjectsForExport()', () => {
index-pattern,
search,
],
workspaces: undefined,
},
],
],
Expand Down Expand Up @@ -670,7 +666,6 @@ describe('getSortedObjectsForExport()', () => {
],
Object {
namespace: undefined,
workspaces: undefined,
},
],
],
Expand Down Expand Up @@ -789,7 +784,6 @@ describe('getSortedObjectsForExport()', () => {
],
Object {
namespace: undefined,
workspaces: undefined,
},
],
Array [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ async function fetchObjectsToExport({
if (typeof search === 'string') {
throw Boom.badRequest(`Can't specify both "search" and "objects" properties when exporting`);
}
const bulkGetResult = await savedObjectsClient.bulkGet(objects, { namespace, workspaces });
const bulkGetResult = await savedObjectsClient.bulkGet(objects, {
namespace,
...(workspaces ? { workspaces } : {}),
});
const erroredObjects = bulkGetResult.saved_objects.filter((obj) => !!obj.error);
if (erroredObjects.length) {
const err = Boom.badRequest();
Expand All @@ -125,7 +128,7 @@ async function fetchObjectsToExport({
search,
perPage: exportSizeLimit,
namespaces: namespace ? [namespace] : undefined,
workspaces,
...(workspaces ? { workspaces } : {}),
});
if (findResponse.total > exportSizeLimit) {
throw Boom.badRequest(`Can't export more than ${exportSizeLimit} objects`);
Expand Down

0 comments on commit 42b744a

Please sign in to comment.