.
This commit is contained in:
parent
681141a8d8
commit
a1e543cfb8
12 changed files with 87 additions and 46 deletions
34
src/autenticacao/_usuarios_quipo_governo.ts
Normal file
34
src/autenticacao/_usuarios_quipo_governo.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||
import { urlAutenticacao } from "./_urlAutenticacao"
|
||||
|
||||
export type tipoUsuarioExterno = {
|
||||
nome: string
|
||||
email: string
|
||||
telefone: string
|
||||
vinculo: string
|
||||
codigo_conta: string
|
||||
chave_produto: string
|
||||
}
|
||||
|
||||
export const usuarios_quipo_governo = async ({
|
||||
token_produto,
|
||||
ambiente,
|
||||
buscar,
|
||||
}: {
|
||||
ambiente: "desenvolvimento" | "producao"
|
||||
token_produto: string
|
||||
buscar: (
|
||||
url: string,
|
||||
headers: { [k: string]: string },
|
||||
) => Promise<tipoResposta<tipoUsuarioExterno[]>>
|
||||
}): Promise<tipoResposta<tipoUsuarioExterno[]>> => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/usuarios_quipo_governo`
|
||||
|
||||
const headers = {
|
||||
token: token_produto,
|
||||
}
|
||||
|
||||
return buscar(url, headers).catch((e) =>
|
||||
respostaComuns.erro(`erro ao buscar usuários quipo governo: ${e}`),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue