.
This commit is contained in:
parent
61c9609581
commit
054daeb1a8
11 changed files with 17 additions and 19 deletions
|
|
@ -1,11 +1,10 @@
|
|||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
export const zAmbiente = z.enum(["desenvolvimento", "producao"]);
|
||||
export const PREFIXO = "/pilao-de-dados";
|
||||
export const PREFIXO_PILAO = "/pilao-de-dados";
|
||||
export const validarZ = (zodType, objeto, mensagem) => {
|
||||
const validar = zodType.safeParse(objeto);
|
||||
if (!validar.success) {
|
||||
debugger;
|
||||
return respostaComuns.erro(mensagem, validar.error.errors.map((e) => `${e.path} ${e.message}`));
|
||||
}
|
||||
return respostaComuns.valor(validar.data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue