varias alteracoes
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-06 14:50:12 +02:00
parent 4f35313d06
commit e65cb26901
333 changed files with 54656 additions and 2058 deletions
+4 -2
View File
@@ -38,6 +38,7 @@ export type Opportunity = {
expected_impact: string | null;
financing_modality: string | null;
status: string;
last_validated_at?: string | null;
};
export type Context = {
primary_territory_path?: { id: string; name: string; location_type: string }[];
@@ -118,15 +119,16 @@ export async function api(url: string, body?: unknown) {
.find((c) => c.startsWith("XSRF-TOKEN="))
?.slice(11) ?? "",
);
const formData = typeof FormData !== "undefined" && body instanceof FormData;
const response = await fetch(url, {
method: body === undefined ? "GET" : "POST",
credentials: "same-origin",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
...(formData ? {} : { "Content-Type": "application/json" }),
"X-XSRF-TOKEN": token,
},
...(body === undefined ? {} : { body: JSON.stringify(body) }),
...(body === undefined ? {} : { body: formData ? body : JSON.stringify(body) }),
});
const data = await response.json();
if (!response.ok) throw new Error(data.message ?? "Não foi possível concluir a operação.");