From 992bb82442927c5cae2e2da56386b57d37b7d295 Mon Sep 17 00:00:00 2001 From: Raj Aryan <65965202+Creatoon@users.noreply.github.com> Date: Sat, 11 Feb 2023 04:14:24 +0530 Subject: [PATCH] Fix: it will always be false unless --- lib/fetcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fetcher.ts b/lib/fetcher.ts index 050e126..a6be117 100644 --- a/lib/fetcher.ts +++ b/lib/fetcher.ts @@ -7,7 +7,7 @@ export default function fetcher(url: string, data = undefined) { }, body: JSON.stringify(data), }).then((res) => { - if (res.status > 399 && res.status < 200) { + if (res.status > 399 || res.status < 200) { throw new Error() } return res.json()