mirror of
https://github.com/portainer/portainer.git
synced 2025-08-06 06:15:22 +02:00
refactor(app): migrate configmap and secret form sections [EE-6233] (#10528)
* refactor(app): migrate configmap and secret form sections [EE-6233]
This commit is contained in:
parent
391b85da41
commit
7a2412b1be
18 changed files with 631 additions and 447 deletions
|
@ -1,4 +1,4 @@
|
|||
import { SecretList } from 'kubernetes-types/core/v1';
|
||||
import { Secret, SecretList } from 'kubernetes-types/core/v1';
|
||||
import { useMutation, useQuery } from 'react-query';
|
||||
|
||||
import { queryClient, withError } from '@/react-tools/react-query';
|
||||
|
@ -129,7 +129,11 @@ async function getSecrets(environmentId: EnvironmentId, namespace: string) {
|
|||
const { data } = await axios.get<SecretList>(
|
||||
buildUrl(environmentId, namespace)
|
||||
);
|
||||
return data.items;
|
||||
const secretsWithKind: Secret[] = data.items.map((secret) => ({
|
||||
...secret,
|
||||
kind: 'Secret',
|
||||
}));
|
||||
return secretsWithKind;
|
||||
} catch (e) {
|
||||
throw parseKubernetesAxiosError(e, 'Unable to retrieve secrets');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue