Validate API request query (#4642)
* fix: refactor to accommodate authentication, transaction and pagination together into ctx.state * feat: allow passing response type to APIContext * feat: preliminary work for initial review * fix: use unknown for base types * fix: api/attachments * fix: api/documents * fix: jsdoc comment for input * fix: replace at() with index access for compatibility * fix: validation err message * fix: error handling * fix: remove unnecessary extend
This commit is contained in:
8
server/routes/api/BaseSchema.ts
Normal file
8
server/routes/api/BaseSchema.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const BaseSchema = z.object({
|
||||
body: z.unknown(),
|
||||
query: z.unknown(),
|
||||
});
|
||||
|
||||
export default BaseSchema;
|
||||
Reference in New Issue
Block a user