Skip to content

Commit

Permalink
Fix type error w/ NotImplemented
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph committed Nov 2, 2023
1 parent 4dd86d3 commit 1d33318
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/api-mocks/msw/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <T extends Record<string, unknown>>(
collection: T[],
Expand Down

0 comments on commit 1d33318

Please sign in to comment.