Skip to content

Commit

Permalink
fix: Undefined cluster in UI when app is referencing cluster by name (#…
Browse files Browse the repository at this point in the history
…9493)

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
  • Loading branch information
alexmt authored May 24, 2022
1 parent df13d96 commit 15adda9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ui/src/app/shared/services/clusters-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ export class ClustersService {
}

public get(url: string, name: string): Promise<models.Cluster> {
let queryName = '';
if (url === undefined) {
url = '';
queryName = `?name=${name}`;
}
const requestUrl = `/clusters/${encodeURIComponent(url)}` + queryName;
const requestUrl = `/clusters/${url ? encodeURIComponent(url) : name}?id.type=${url ? 'url' : 'name'}`;
return requests.get(requestUrl).then(res => res.body as models.Cluster);
}

Expand Down

0 comments on commit 15adda9

Please sign in to comment.