refatoração
This commit is contained in:
parent
117bdbef7b
commit
8b8406e245
28 changed files with 300 additions and 51 deletions
|
|
@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { PREFIXO, tiposColunasBasedados, } from "./_variaveis";
|
||||
import { PREFIXO, baseUrlPilao, tiposColunasBasedados, } from "./_variaveis";
|
||||
/** Faz o registro de uma nova base de dados configurado a estrutura de colunas */
|
||||
export const zp_registrar_base_dados = z.object({
|
||||
tabela: z.string(),
|
||||
|
|
@ -19,9 +19,7 @@ export const zp_registrar_base_dados = z.object({
|
|||
})),
|
||||
});
|
||||
export const registrar_base_dados = ({ emDesenvolvimento, cliente: { conta, produto }, parametros: { colunas, tabela }, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const url = new URL(`${emDesenvolvimento
|
||||
? "http://127.0.0.1:5080"
|
||||
: "https://carro-de-boi.idz.one"}${`${PREFIXO}/registar-base-dados/${produto}/${conta}`}`);
|
||||
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${`${PREFIXO}/${Object.keys({ registrar_base_dados })[0]}/${produto}/${conta}`}`);
|
||||
const resp = yield fetch(url.toString(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ tabela, colunas }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue