Ajout possibilité de configurer le champ permettant de créer la liste des derniers quizs
This commit is contained in:
parent
71b71a2520
commit
df0bacf181
@ -39,6 +39,7 @@ module.exports =
|
||||
hourGiveNewQuestionnaireEnd: 8, // idem
|
||||
numberNewQuestionnaireAtSameTime: 50, // for mass mailing sending new quiz
|
||||
minSearchQuestionnaires: 3,
|
||||
fieldNewQuestionnaires : "publishingAt", // field to be used to create the list of the last questionnaires, can be "createdAt", "updatedAt" or "publishingAt"
|
||||
// Illustrations:
|
||||
nbIllustrationsMin: 0,
|
||||
nbIllustrationsMax: 1,
|
||||
|
@ -586,7 +586,7 @@ const checkQuestionnairesPublishedHaveHTML = async (regenerate=false) =>
|
||||
const creaNewQuestionnairesJson = async () =>
|
||||
{
|
||||
const db = require("../models/index");
|
||||
const Questionnaires=await db["Questionnaire"].findAll({ where: { isPublished : true }, order: [["updatedAt", "DESC"], ["id", "DESC"]], attributes: ["id"], limit: config.nbNewQuestionnaires });
|
||||
const Questionnaires=await db["Questionnaire"].findAll({ where: { isPublished : true }, order: [[config.fieldNewQuestionnaires, "DESC"], ["id", "DESC"]], attributes: ["id"], limit: config.nbNewQuestionnaires });
|
||||
if(Questionnaires)
|
||||
{
|
||||
await toolFile.createJSON(config.dirCacheQuestionnaires, "last", Questionnaires);
|
||||
|
Loading…
Reference in New Issue
Block a user