From ce07cece063f2bc09323951e6a2bf2bbfadcd9ff Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 5 Dec 2023 01:52:10 +0100 Subject: [PATCH] Clean up 204 handling on the front --- front/packages/models/src/query.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/front/packages/models/src/query.tsx b/front/packages/models/src/query.tsx index 60e49ecb..5339bb10 100644 --- a/front/packages/models/src/query.tsx +++ b/front/packages/models/src/query.tsx @@ -117,9 +117,8 @@ export const queryFn = async ( throw data as KyooErrors; } - // If the method is DELETE, 204 NoContent is returned from kyoo. - // @ts-ignore - if (context.method === "DELETE") return undefined; + // @ts-expect-error Assume Data is nullable. + if (resp.status === 204) return null; let data; try {