feat: frontend validation
fix
This commit is contained in:
@ -10,6 +10,7 @@ import {
|
||||
pipe,
|
||||
strictObject,
|
||||
string,
|
||||
union,
|
||||
uuid,
|
||||
variant,
|
||||
} from "valibot";
|
||||
@ -165,11 +166,24 @@ const userImageValidator = strictObject({
|
||||
}),
|
||||
});
|
||||
|
||||
const userProcessingImageValidator = strictObject({
|
||||
ID: pipe(string(), uuid()),
|
||||
ImageID: pipe(string(), uuid()),
|
||||
UserID: pipe(string(), uuid()),
|
||||
Image: strictObject({
|
||||
ID: pipe(string(), uuid()),
|
||||
ImageName: string(),
|
||||
Image: null_(),
|
||||
}),
|
||||
Status: union([literal("not-started"), literal("in-progress")]),
|
||||
});
|
||||
|
||||
export type UserImage = InferOutput<typeof dataTypeValidator>;
|
||||
|
||||
const imageRequestValidator = strictObject({
|
||||
UserImages: array(userImageValidator),
|
||||
ImageProperties: array(dataTypeValidator),
|
||||
ProcessingImages: array(userProcessingImageValidator),
|
||||
});
|
||||
|
||||
export const getUserImages = async (): Promise<
|
||||
|
Reference in New Issue
Block a user