Return empty array instead of 404

This commit is contained in:
Methapon2001 2024-02-16 14:07:41 +07:00
parent 87306f1dce
commit 32076a8936
No known key found for this signature in database
GPG key ID: 849924FEF46BD132

View file

@ -128,7 +128,7 @@ export async function list(operation: "file" | "folder", path: string[]) {
if (!res || !res.ok) {
if (res && res.status === HttpStatus.NOT_FOUND) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแฟ้ม/ไฟล์ในระบบ");
return [];
}
return Boolean(console.error(res ? await res.json() : res));
}