mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 14:59:41 +02:00
fix showing namespaces for standard user (#7917)
This commit is contained in:
parent
446febb0f6
commit
a550bfaedb
6 changed files with 77 additions and 7 deletions
|
@ -8,23 +8,23 @@ export async function getNamespace(
|
|||
namespace: string
|
||||
) {
|
||||
try {
|
||||
const { data: ingress } = await axios.get<Namespaces>(
|
||||
const { data: ns } = await axios.get<Namespaces>(
|
||||
buildUrl(environmentId, namespace)
|
||||
);
|
||||
return ingress;
|
||||
return ns;
|
||||
} catch (e) {
|
||||
throw parseAxiosError(e as Error, 'Unable to retrieve network details');
|
||||
throw parseAxiosError(e as Error, 'Unable to retrieve namespace');
|
||||
}
|
||||
}
|
||||
|
||||
export async function getNamespaces(environmentId: EnvironmentId) {
|
||||
try {
|
||||
const { data: ingresses } = await axios.get<Namespaces>(
|
||||
const { data: namespaces } = await axios.get<Namespaces>(
|
||||
buildUrl(environmentId)
|
||||
);
|
||||
return ingresses;
|
||||
return namespaces;
|
||||
} catch (e) {
|
||||
throw parseAxiosError(e as Error, 'Unable to retrieve network details');
|
||||
throw parseAxiosError(e as Error, 'Unable to retrieve namespaces');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue