From 7a66bdf13921877698b897f231463f0d7e83fd2d Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 23 Dec 2024 22:46:01 +0800 Subject: [PATCH] fix: fix typo --- ui/src/api/notify.ts | 4 ++-- ui/src/api/statistics.ts | 4 ++-- ui/src/api/workflow.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/api/notify.ts b/ui/src/api/notify.ts index b51f22d9..6eb078ab 100644 --- a/ui/src/api/notify.ts +++ b/ui/src/api/notify.ts @@ -15,8 +15,8 @@ export const notifyTest = async (channel: string) => { }, }); - if (resp.status != 0 && resp.status !== 200) { - throw new ClientResponseError({ status: resp.status, response: resp, data: {} }); + if (resp.code != 0) { + throw new ClientResponseError({ status: resp.code, response: resp, data: {} }); } return resp; diff --git a/ui/src/api/statistics.ts b/ui/src/api/statistics.ts index 98e77c2a..6c1d422c 100644 --- a/ui/src/api/statistics.ts +++ b/ui/src/api/statistics.ts @@ -10,8 +10,8 @@ export const get = async () => { method: "GET", }); - if (resp.status != 0 && resp.status !== 200) { - throw new ClientResponseError({ status: resp.status, response: resp, data: {} }); + if (resp.code != 0) { + throw new ClientResponseError({ status: resp.code, response: resp, data: {} }); } return resp.data as Statistics; diff --git a/ui/src/api/workflow.ts b/ui/src/api/workflow.ts index 473d0e25..2828445f 100644 --- a/ui/src/api/workflow.ts +++ b/ui/src/api/workflow.ts @@ -15,8 +15,8 @@ export const run = async (id: string) => { }, }); - if (resp.status != 0 && resp.status !== 200) { - throw new ClientResponseError({ status: resp.status, response: resp, data: {} }); + if (resp.code != 0) { + throw new ClientResponseError({ status: resp.code, response: resp, data: {} }); } return resp;