build: include production build artifacts in repo
This commit is contained in:
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
import { BadRequestException } from "@nestjs/common";
|
||||
import { toIssues } from "@imen/shared";
|
||||
import { z } from "zod";
|
||||
z.config(z.locales.fa());
|
||||
export class ZodPipe {
|
||||
schema;
|
||||
constructor(schema) {
|
||||
this.schema = schema;
|
||||
}
|
||||
transform(value) {
|
||||
const result = this.schema.safeParse(value);
|
||||
if (!result.success) {
|
||||
throw new BadRequestException({
|
||||
statusCode: 400,
|
||||
message: "اطلاعات واردشده معتبر نیست",
|
||||
issues: toIssues(result.error),
|
||||
});
|
||||
}
|
||||
return result.data;
|
||||
}
|
||||
}
|
||||
export const IdPipe = new ZodPipe(z.coerce.number().int().positive());
|
||||
//# sourceMappingURL=zod.pipe.js.map
|
||||
Reference in New Issue
Block a user