Skip to content

Commit

Permalink
fix(fetch functions): now support Firefox, bump ED api version
Browse files Browse the repository at this point in the history
  • Loading branch information
Truiteseche committed Mar 2, 2024
1 parent 4edfb80 commit d41b6df
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function consoleLogEDPLogo() {
consoleLogEDPLogo();

const currentEDPVersion = "0.2.5";
const apiVersion = "4.52.0";
const apiVersion = "4.52.1";

// secret webhooks
const carpeConviviale = "CARPE_CONVIVIALE_WEBHOOK_URL";
Expand Down Expand Up @@ -1139,7 +1139,7 @@ export default function App() {
{
method: "POST",
headers: {
"user-agent": navigator.userAgent,
// "user-agent": navigator.userAgent,
"x-token": tokenState,
},
body: `data=${JSON.stringify(data)}`,
Expand Down Expand Up @@ -1191,7 +1191,7 @@ export default function App() {
{
method: "POST",
headers: {
"user-agent": navigator.userAgent,
// "user-agent": navigator.userAgent,
"x-token": tokenState
},
cors: "no-cors",
Expand All @@ -1218,7 +1218,7 @@ export default function App() {
abortControllers.current.push(controller);
const userId = activeAccount;
const data = {
anneeScolaire: getUserSettingValue("isSchoolYearEnabled") ? getUserSettingValue("schoolYear").join("-") : ""
anneeScolaire: getUserSettingValue("isSchoolYearEnabled") ? getUserSettingValue("schoolYear").join("-") : "",
// token: tokenState
}
// await new Promise(resolve => setTimeout(resolve, 5000)); // timeout de 1.5s le fetch pour les tests des content-loaders
Expand All @@ -1231,14 +1231,12 @@ export default function App() {
{
method: "POST",
headers: {
"user-agent": navigator.userAgent,
// "user-agent": navigator.userAgent,
"x-token": tokenState
},
body: `data=${JSON.stringify(data)}`,
signal: controller.signal,
referrerPolicy: "no-referrer",
mode: "cors",
"Sec-Fetch-Mode": "cors"
},
)
.then((response) => response.json())
Expand Down Expand Up @@ -1294,7 +1292,7 @@ export default function App() {
{
method: "POST",
headers: {
"user-agent": navigator.userAgent,
// "user-agent": navigator.userAgent,
"x-token": tokenState,
},
body: `data=${JSON.stringify(data)}`,
Expand Down Expand Up @@ -1342,7 +1340,7 @@ export default function App() {
{
method: "POST",
headers: {
"user-agent": navigator.userAgent,
// "user-agent": navigator.userAgent,
"x-token": tokenState,
},
body: `data=${JSON.stringify(data)}`,
Expand Down

0 comments on commit d41b6df

Please sign in to comment.