mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 01:52:22 +00:00
Add more audit log events
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { nanoid } from "nanoid";
|
||||
import { Types } from "mongoose";
|
||||
import Folder, { TFolderSchema } from "../models/folder";
|
||||
import Folder, { TFolderSchema, TFolderRootSchema } from "../models/folder";
|
||||
import { ResourceNotFoundError } from "../utils/errors";
|
||||
|
||||
type TAppendFolderDTO = {
|
||||
folderName: string;
|
||||
@@ -172,6 +173,20 @@ export const searchByFolderIdWithDir = (
|
||||
return;
|
||||
};
|
||||
|
||||
export const getFolderPath = (
|
||||
folders: TFolderRootSchema,
|
||||
folderId: string
|
||||
) => {
|
||||
const folderBySearch = searchByFolderIdWithDir(folders.nodes, folderId);
|
||||
|
||||
if (!folderBySearch) throw ResourceNotFoundError({
|
||||
message: "Failed to find folder"
|
||||
});
|
||||
|
||||
const folderPath = folderBySearch.dir.map((folder) => folder.name).join("/");
|
||||
return folderPath;
|
||||
}
|
||||
|
||||
// to get folder of a path given
|
||||
// Like /frontend/folder#1
|
||||
export const getFolderByPath = (folders: TFolderSchema, searchPath: string) => {
|
||||
|
||||
Reference in New Issue
Block a user