Files
supabase/apps/docs/app/api/utils.ts
T
Charis a0f5c798df feat(content api): add dummy api/graphql route (#35141)
The first PR in a series to build out the Content API. Adds a dummy
GraphQL route with some tests: for now all this does is validate the
request body and return a 404.
2025-04-29 13:02:36 -04:00

30 lines
403 B
TypeScript

import { z } from 'zod'
export class ApiError extends Error {
constructor(message: string) {
super(message)
}
isPrivate() {
return true
}
statusCode() {
return 500
}
}
export class InvalidRequestError extends ApiError {
constructor(message: string) {
super(`Invalid request: ${message}`)
}
isPrivate() {
return false
}
statusCode() {
return 400
}
}