mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-02 08:09:10 +00:00
14 lines
346 B
TypeScript
14 lines
346 B
TypeScript
import z, { type ZodSchema } from "zod";
|
|
|
|
export function createResponseBodySchema<T extends ZodSchema>(dataSchema: T) {
|
|
return z.object({
|
|
data: dataSchema.nullable(),
|
|
success: z.boolean(),
|
|
error: z.boolean(),
|
|
message: z.string(),
|
|
status: z.number()
|
|
});
|
|
}
|
|
|
|
export default createResponseBodySchema;
|