mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-22 11:31:39 +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')) {
|
||||
const workspaces = await this.workspaceRepository.find({
|
||||
order: {
|
||||
createdAt: 'DESC',
|
||||
createdAt: 'ASC',
|
||||
},
|
||||
relations: ['workspaceSSOIdentityProviders'],
|
||||
});
|
||||
@ -164,7 +164,7 @@ export class DomainManagerService {
|
||||
),
|
||||
);
|
||||
|
||||
return nonSeedWorkspace ?? workspaces[workspaces.length - 1];
|
||||
return nonSeedWorkspace ?? workspaces[0];
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
|
Loading…
Reference in New Issue
Block a user