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.
This commit is contained in:
Methapon2001 2024-03-18 20:11:14 +07:00
parent 6d41280fe6
commit 0b1c1295dd
No known key found for this signature in database
GPG key ID: 849924FEF46BD132

View file

@ -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) {