feat: filtre les scores en production
This commit is contained in:
parent
2960b936b1
commit
7a61fc4907
|
@ -10,5 +10,6 @@ module.exports = {
|
|||
],
|
||||
env: {
|
||||
"vue/setup-compiler-macros": true,
|
||||
node: true,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -47,7 +47,11 @@ async function fetchScoresData() {
|
|||
const url = `/items/scores?${fields
|
||||
.map((item) => `fields[]=${item}`)
|
||||
.join("&")}`;
|
||||
const scores = (await fetchJSONApi(url)).data;
|
||||
let scores = (await fetchJSONApi(url)).data;
|
||||
if (process.env.NODE_ENV != "staging") {
|
||||
console.log("Suppresion des scores avec le mode brouillon en production");
|
||||
scores = scores.filter((score) => !score.draft);
|
||||
}
|
||||
await fs.writeFile("./src/data.json", JSON.stringify(scores), "utf8");
|
||||
|
||||
const folder = "public/answers";
|
||||
|
|
Loading…
Reference in New Issue