[MVPTN-80] deploy(Docker): Ajuste de API de requisição
This commit is contained in:
parent
f3f1329c3e
commit
4f3be03f3b
1 changed files with 7 additions and 5 deletions
|
|
@ -37,15 +37,17 @@ export default class API {
|
|||
// Verifica se existe body para envio
|
||||
const filteredBody = _data.body
|
||||
? Object.fromEntries(
|
||||
Object.entries(_data.body).filter(
|
||||
([_, v]) => v != null && v !== "",
|
||||
),
|
||||
)
|
||||
Object.entries(_data.body).filter(
|
||||
([_, v]) => v != null && v !== "",
|
||||
),
|
||||
)
|
||||
: null;
|
||||
|
||||
const url = `${this.ApiSchema.url}${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`;
|
||||
|
||||
// Realiza a requisição
|
||||
const response = await fetch(
|
||||
`${this.ApiSchema.url}${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`,
|
||||
url,
|
||||
{
|
||||
method: _data.method,
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue