Skip to content

Commit 414fd53

Browse files
authored
Merge pull request #2139 from HarshMN2345/fix-SER-24-onboarding-project-id-undefined
2 parents cc1bb36 + 9ab05fb commit 414fd53

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/lib/components/breadcrumbs.svelte

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@
103103
isLoadingProjects = true;
104104
// null on non-org/project path like `onboarding`.
105105
loadedProjects = (await projects) ?? loadedProjects;
106+
for (const project of loadedProjects.projects) {
107+
project.region ??= 'default';
108+
}
106109
isLoadingProjects = false;
107110
108111
const createProjectItem = {
@@ -112,10 +115,12 @@
112115
};
113116
114117
if (loadedProjects.total > 1 && selectedOrg) {
115-
const projectLinks = loadedProjects.projects.slice(0, 4).map((project) => ({
116-
name: project.name,
117-
href: `${base}/project-${project.region}-${project.$id}/overview/platforms`
118-
}));
118+
const projectLinks = loadedProjects.projects.slice(0, 4).map((project) => {
119+
return {
120+
name: project.name,
121+
href: `${base}/project-${project.region}-${project.$id}/overview/platforms`
122+
};
123+
});
119124
120125
if (loadedProjects.projects.length > 4) {
121126
projectLinks.push({

src/routes/(console)/+layout.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export const load: LayoutLoad = async ({ depends, parent }) => {
3737
Query.equal('teamId', currentOrgId),
3838
Query.limit(1000) // Get all projects for organization
3939
]);
40+
for (const project of projects.projects) {
41+
project.region ??= 'default';
42+
}
4043
} catch (e) {
4144
// Handle error silently - projects might not be accessible
4245
projects = {};

src/routes/(console)/project-[region]-[project]/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
1616
depends(Dependencies.PROJECT);
1717

1818
const project = await sdk.forConsole.projects.get(params.project);
19+
project.region ??= 'default';
1920

2021
// fast path without a network call!
2122
let organization = (organizations as OrganizationList)?.teams?.find(

0 commit comments

Comments
 (0)