From b442cc186a5edc3bb2dc4e46372625822827664e Mon Sep 17 00:00:00 2001 From: sayanm16 Date: Mon, 21 Oct 2024 16:24:41 +0530 Subject: [PATCH] Fix: Handle json correctly on delete response recieved --- frontend/src/settings/APIKeys.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/settings/APIKeys.tsx b/frontend/src/settings/APIKeys.tsx index e230f272..b17b90ae 100644 --- a/frontend/src/settings/APIKeys.tsx +++ b/frontend/src/settings/APIKeys.tsx @@ -42,7 +42,8 @@ export default function APIKeys() { return response.json(); }) .then((data) => { - data.status === 'ok' && + console.log(data); + data.success === true && setApiKeys((previous) => previous.filter((elem) => elem.id !== id)); }) .catch((error) => {