refactor(data): replace schema classes with readonly models
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import {
|
||||
createSchemaModel,
|
||||
type SchemaModel,
|
||||
} from "../../schema_model";
|
||||
|
||||
export const FeedbackSubmitResponseSchema = z.object({
|
||||
feedbackId: z.string().min(1),
|
||||
});
|
||||
export const FeedbackSubmitResponseSchema = z
|
||||
.object({
|
||||
feedbackId: z.string().min(1),
|
||||
})
|
||||
.readonly();
|
||||
|
||||
export type FeedbackSubmitResponseInput = z.input<
|
||||
typeof FeedbackSubmitResponseSchema
|
||||
@@ -15,12 +12,4 @@ export type FeedbackSubmitResponseInput = z.input<
|
||||
export type FeedbackSubmitResponseData = z.output<
|
||||
typeof FeedbackSubmitResponseSchema
|
||||
>;
|
||||
|
||||
export type FeedbackSubmitResponse = SchemaModel<
|
||||
typeof FeedbackSubmitResponseSchema,
|
||||
"feedbackId"
|
||||
>;
|
||||
export const FeedbackSubmitResponse = createSchemaModel<
|
||||
typeof FeedbackSubmitResponseSchema,
|
||||
"feedbackId"
|
||||
>(FeedbackSubmitResponseSchema);
|
||||
export type FeedbackSubmitResponse = FeedbackSubmitResponseData;
|
||||
|
||||
Reference in New Issue
Block a user