From 32076a893688332996e9db44256dbb945ee0fda5 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:07:41 +0700 Subject: [PATCH] Return empty array instead of 404 --- src/services/edm.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/edm.ts b/src/services/edm.ts index 176c4da..9f87960 100644 --- a/src/services/edm.ts +++ b/src/services/edm.ts @@ -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)); }