refactor(data): replace schema classes with readonly models
This commit is contained in:
@@ -3,11 +3,7 @@
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
import {
|
||||
booleanOrFalse,
|
||||
schemaOr,
|
||||
stringOrNull,
|
||||
} from "../nullable-defaults";
|
||||
import { booleanOrFalse, schemaOr, stringOrNull } from "../nullable-defaults";
|
||||
|
||||
const CHAT_IMAGE_DEFAULTS = { type: null, url: null } as const;
|
||||
|
||||
@@ -22,7 +18,7 @@ export const ChatImageSchema = schemaOr(
|
||||
url: stringOrNull,
|
||||
}),
|
||||
CHAT_IMAGE_DEFAULTS,
|
||||
);
|
||||
).readonly();
|
||||
|
||||
export const ChatLockDetailSchema = schemaOr(
|
||||
z.object({
|
||||
@@ -30,7 +26,7 @@ export const ChatLockDetailSchema = schemaOr(
|
||||
reason: stringOrNull,
|
||||
}),
|
||||
CHAT_LOCK_DETAIL_DEFAULTS,
|
||||
);
|
||||
).readonly();
|
||||
|
||||
export type ChatImageInput = z.input<typeof ChatImageSchema>;
|
||||
export type ChatImageData = z.output<typeof ChatImageSchema>;
|
||||
|
||||
Reference in New Issue
Block a user