From 0b1c1295ddbc64e48a8af6972f5eef3a2f0b7649 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Mon, 18 Mar 2024 20:11:14 +0700 Subject: [PATCH] feat: hidden file under folder start with "." All file under hidden folder cannot be found with search operation by any means. Still be able to list file or folders through API. --- src/services/edm.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/edm.ts b/src/services/edm.ts index 9f87960..3415af2 100644 --- a/src/services/edm.ts +++ b/src/services/edm.ts @@ -106,7 +106,7 @@ export async function createFile(path: string[], file: string, props?: FileProps ...props, path, file, - hidden: false, + hidden: path.some((v) => v.startsWith(".")), }), }).catch((e) => console.error(e)); @@ -123,7 +123,7 @@ export async function list(operation: "file" | "folder", path: string[]) { Authorization: `Bearer ${await getToken()}`, "Content-Type": "application/json", }, - body: JSON.stringify({ operation, path, hidden: false }), + body: JSON.stringify({ operation, path, hidden: true }), }).catch((e) => console.error(e)); if (!res || !res.ok) {