Skip to content

Commit cf0d530

Browse files
jleveuglejleveugle
authored andcommitted
fix: avoid calling api with empty id of project
1 parent 05f1fcb commit cf0d530

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/manager/modules/pci/src/projects/project/project.routing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export default /* @ngInject */ ($stateProvider) => {
3434
},
3535
resolve: {
3636
projectId: /* @ngInject */ $transition$ => $transition$.params().projectId,
37-
project: /* @ngInject */ (OvhApiCloudProject, $transition$) => OvhApiCloudProject
37+
project: /* @ngInject */ (OvhApiCloudProject, projectId) => OvhApiCloudProject
3838
.v6()
3939
.get({
40-
serviceName: $transition$.params().projectId,
40+
serviceName: projectId,
4141
})
4242
.$promise,
4343
breadcrumb: /* @ngInject */ project => (project.status !== 'creating'

packages/manager/modules/pci/src/projects/project/sidebar/sidebar.controller.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ export default class SidebarController {
4343
}
4444

4545
setProject(serviceName) {
46+
if (isEmpty(serviceName)) {
47+
return null;
48+
}
49+
4650
this.isLoading = true;
4751

48-
this.SidebarMenu.setInitializationPromise(
52+
return this.SidebarMenu.setInitializationPromise(
4953
this.OvhApiCloudProject
5054
.v6()
5155
.get({

0 commit comments

Comments
 (0)