Skip to content

Commit

Permalink
feat: update snapshot
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe committed Sep 29, 2023
1 parent 8cd7c8c commit 1898fc6
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 1898fc6

Please sign in to comment.