mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-22 19:41:53 +03:00
fix(domain-manager): prioritize non-seed workspaces in selection
Updated workspace selection logic to prioritize non-seed workspaces. Returns a seed workspace only if no non-seed workspaces are available to improve filtering consistency and avoid unintended behavior.
This commit is contained in:
parent
56daedb78f
commit
80b57cf957
@ -145,7 +145,7 @@ export class DomainManagerService {
|
|||||||
if (!this.environmentService.get('IS_MULTIWORKSPACE_ENABLED')) {
|
if (!this.environmentService.get('IS_MULTIWORKSPACE_ENABLED')) {
|
||||||
const workspaces = await this.workspaceRepository.find({
|
const workspaces = await this.workspaceRepository.find({
|
||||||
order: {
|
order: {
|
||||||
createdAt: 'DESC',
|
createdAt: 'ASC',
|
||||||
},
|
},
|
||||||
relations: ['workspaceSSOIdentityProviders'],
|
relations: ['workspaceSSOIdentityProviders'],
|
||||||
});
|
});
|
||||||
@ -164,7 +164,7 @@ export class DomainManagerService {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return nonSeedWorkspace ?? workspaces[workspaces.length - 1];
|
return nonSeedWorkspace ?? workspaces[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
Loading…
Reference in New Issue
Block a user