Fix: Added explicit SecretType type

This commit is contained in:
Daniel Hougaard
2024-06-21 15:23:50 +02:00
parent 9c06cab99d
commit d0f8394f50
9 changed files with 41 additions and 29 deletions
@@ -64,7 +64,7 @@ import {
} from "@app/hooks/api";
import { useUpdateFolderBatch } from "@app/hooks/api/secretFolders/queries";
import { TUpdateFolderBatchDTO } from "@app/hooks/api/secretFolders/types";
import { TSecretFolder } from "@app/hooks/api/types";
import { SecretType, TSecretFolder } from "@app/hooks/api/types";
import { ProjectVersion } from "@app/hooks/api/workspace/types";
import { FolderForm } from "../SecretMainPage/components/ActionBar/FolderForm";
@@ -320,7 +320,7 @@ export const SecretOverviewPage = () => {
secretName: key,
secretValue: value,
secretComment: "",
type: "shared",
type: SecretType.Shared,
latestFileKey: latestFileKey!
});
createNotification({
@@ -344,7 +344,13 @@ export const SecretOverviewPage = () => {
}
};
const handleSecretUpdate = async (env: string, key: string, value: string, secretId?: string) => {
const handleSecretUpdate = async (
env: string,
key: string,
value: string,
type = SecretType.Shared,
secretId?: string
) => {
try {
await updateSecretV3({
environment: env,
@@ -353,7 +359,7 @@ export const SecretOverviewPage = () => {
secretId,
secretName: key,
secretValue: value,
type: "shared",
type,
latestFileKey: latestFileKey!
});
createNotification({
@@ -377,7 +383,7 @@ export const SecretOverviewPage = () => {
secretPath,
secretName: key,
secretId,
type: "shared"
type: SecretType.Shared
});
createNotification({
type: "success",