frontend et backend: Formulaire dynamique

This commit is contained in:
Divlo
2020-03-24 16:11:55 +01:00
parent b479e1501f
commit 2c61a22787
19 changed files with 353 additions and 71 deletions

View File

@ -11,12 +11,11 @@ function helperQueryNumber(value, defaultValue) {
}
exports.getFunctions = (req, res, next) => {
const page = helperQueryNumber(req.query.page, 1);
const limit = helperQueryNumber(req.query.limit, 10);
const page = helperQueryNumber(req.query.page, 1);
const limit = helperQueryNumber(req.query.limit, 10);
const categoryId = helperQueryNumber(req.query.categoryId, 0);
let search = req.query.search;
try { search = search.toLowerCase(); } catch {}
const offset = (page - 1) * limit;
const search = req.query.search.toLowerCase();
const offset = (page - 1) * limit;
Functions.findAndCountAll({
limit,
offset,