From 1d33318a5d8601bc05b6555a9cbb3f2b2306a107 Mon Sep 17 00:00:00 2001 From: Justin Bennett Date: Thu, 2 Nov 2023 12:39:55 -0400 Subject: [PATCH] Fix type error w/ NotImplemented --- libs/api-mocks/msw/util.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/api-mocks/msw/util.ts b/libs/api-mocks/msw/util.ts index f1f56842e..4e153262c 100644 --- a/libs/api-mocks/msw/util.ts +++ b/libs/api-mocks/msw/util.ts @@ -90,7 +90,11 @@ export function getTimestamps() { export const unavailableErr = () => json({ error_code: 'ServiceUnavailable' }, { status: 503 }) -export const NotImplemented = () => json({ error_code: 'NotImplemented' }, { status: 501 }) +export const NotImplemented = () => { + // This doesn't just return the response because it broadens the type to be usable + // directly as a handler + throw json({ error_code: 'NotImplemented' }, { status: 501 }) +} export const errIfExists = >( collection: T[],