mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 03:28:58 +00:00
Changed frontend to use the new secrets routes
This commit is contained in:
@@ -273,7 +273,7 @@ export const updateSecrets = async (req: Request, res: Response) => {
|
||||
});
|
||||
await Secret.bulkWrite(ops);
|
||||
|
||||
let newSecretsObj: { [key: string]: PatchSecret } = {};
|
||||
const newSecretsObj: { [key: string]: PatchSecret } = {};
|
||||
req.body.secrets.forEach((secret: PatchSecret) => {
|
||||
newSecretsObj[secret.id] = secret;
|
||||
});
|
||||
@@ -323,7 +323,7 @@ export const updateSecrets = async (req: Request, res: Response) => {
|
||||
|
||||
// group secrets into workspaces so updated secrets can
|
||||
// be logged and snapshotted separately for each workspace
|
||||
let workspaceSecretObj: any = {};
|
||||
const workspaceSecretObj: any = {};
|
||||
req.secrets.forEach((s: any) => {
|
||||
if (s.workspace.toString() in workspaceSecretObj) {
|
||||
workspaceSecretObj[s.workspace.toString()].push(s);
|
||||
@@ -399,7 +399,7 @@ export const deleteSecrets = async (req: Request, res: Response) => {
|
||||
|
||||
// group secrets into workspaces so deleted secrets can
|
||||
// be logged and snapshotted separately for each workspace
|
||||
let workspaceSecretObj: any = {};
|
||||
const workspaceSecretObj: any = {};
|
||||
req.secrets.forEach((s: any) => {
|
||||
if (s.workspace.toString() in workspaceSecretObj) {
|
||||
workspaceSecretObj[s.workspace.toString()].push(s);
|
||||
@@ -445,7 +445,7 @@ export const deleteSecrets = async (req: Request, res: Response) => {
|
||||
}
|
||||
});
|
||||
|
||||
return res.status(400).send({
|
||||
return res.status(200).send({
|
||||
secrets: req.secrets
|
||||
});
|
||||
}
|
||||
@@ -138,7 +138,7 @@ router.patch(
|
||||
router.delete(
|
||||
'/',
|
||||
[
|
||||
check('secretIds')
|
||||
body('secretIds')
|
||||
.exists()
|
||||
.custom((value) => {
|
||||
// case: delete 1 secret
|
||||
|
||||
@@ -7,12 +7,12 @@ import {
|
||||
} from '../config';
|
||||
import { getLogger } from '../utils/logger';
|
||||
|
||||
if(TELEMETRY_ENABLED){
|
||||
if(!TELEMETRY_ENABLED){
|
||||
getLogger("backend-main").info([
|
||||
"",
|
||||
"Infisical collects telemetry data about general usage.",
|
||||
"The data helps us understand how the product is doing and guide our product development to create the best possible platform; it also helps us demonstrate growth for investors as we support Infisical as open-source software.",
|
||||
"To opt out of telemetry, you can set `TELEMETRY_ENABLED=false` within the environment variables",
|
||||
"To improve, Infisical collects telemetry data about general usage.",
|
||||
"This helps us understand how the product is doing and guide our product development to create the best possible platform; it also helps us demonstrate growth as we support Infisical as open-source software.",
|
||||
"To opt into telemetry, you can set `TELEMETRY_ENABLED=true` within the environment variables.",
|
||||
].join('\n'))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user