z_validar_colunna_base_dados
This commit is contained in:
parent
4d5de45443
commit
f6f39d2d86
21 changed files with 221 additions and 300 deletions
|
|
@ -9,11 +9,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { PREFIXO, baseUrlPilao } from "./_variaveis";
|
||||
import { PREFIXO, baseUrlPilao, z_tipo_coluna_base_dados, } from "./_variaveis";
|
||||
export const zp_registrar_base_dados = z.object({
|
||||
tabela: z.string(),
|
||||
colunas: z.array(z.object({
|
||||
coluna: z.string(),
|
||||
tipo: z_tipo_coluna_base_dados,
|
||||
})),
|
||||
});
|
||||
//enviar registros para base de dados
|
||||
export const zp_enviar_registros = z.object({
|
||||
tabela: z.string(),
|
||||
registros: z.array(z.any()),
|
||||
registros: z.array(z.object({
|
||||
coluna: z.string(),
|
||||
valor: z.any(),
|
||||
tipo: z_tipo_coluna_base_dados,
|
||||
})),
|
||||
});
|
||||
export const enviar_registros = ({ emDesenvolvimento, cliente: { conta, produto }, parametros: { registros, tabela }, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${PREFIXO}/${Object.keys({ enviar_registros })[0]}/${produto}/${conta}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue