Skip to content

Commit

Permalink
feat: change logic
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Jul 27, 2023
1 parent 5006c15 commit d93b725
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/server/saved_objects/service/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ export class SavedObjectsRepository {
* We need to create a new object when the object
* is about to import into workspaces it is not belong to
*/
if (this.isWorkspaceSpecificObject(transformedObject) && filteredWorkspaces.length) {
if (!this.isPublicWorkspace(options.workspaces) && filteredWorkspaces.length) {
/**
* Create a new object but only belong to the set of (target workspaces - original workspace)
*/
Expand All @@ -546,7 +546,9 @@ export class SavedObjectsRepository {
savedObjectWorkspaces = transformedObject.workspaces;
}
} else {
changeToCreate();
savedObjectWorkspaces = this.isPublicWorkspace(options.workspaces)
? undefined
: options.workspaces;
}
}

Expand Down

0 comments on commit d93b725

Please sign in to comment.