Skip to content
Snippets Groups Projects
Commit aaf98649 authored by sandcha's avatar sandcha
Browse files

Remove DEBUG mode in api-budget script and fix after amendement example removal

parent 2ae22388
No related branches found
No related tags found
1 merge request!5Désactive le PLF 2022
......@@ -98,14 +98,6 @@ const RESPONSE_EXAMPLE: ApiResponse = {
},
}
// DEBUG
// -----
const DEBUG_AND_BYPASS_API: boolean = false
const DEBUG_AND_BYPASS_JWT = false
const JWT_ME = "MON_TOKEN"
// FUNCTIONS
// ---------
......@@ -133,9 +125,7 @@ export async function calculateBudget(
console.log("Pas d'amendement à calculer.")
} else {
console.log("Amendement à calculer :", amendement)
request.amendement = DEBUG_AND_BYPASS_API
? { ...AMENDEMENT_EXAMPLE_2 }
: { ...amendement }
request.amendement = { ...amendement }
}
if (plf === undefined) {
......@@ -153,7 +143,7 @@ export async function calculateBudget(
headers: new Headers({
accept: "application/json",
"Content-Type": "application/json",
"jwt-token": DEBUG_AND_BYPASS_JWT ? JWT_ME : jwt,
"jwt-token": jwt,
}),
//credentials: "omit", // <- À décommenter si, côté serveur, nous avons : Allow-Origin: *
//credentials: "include",
......@@ -206,5 +196,5 @@ export async function calculateBudget(
console.error("Erreur inattendue : ", response.status)
}
return DEBUG_AND_BYPASS_API ? RESPONSE_EXAMPLE : responseJson
return responseJson
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment