Answer the question
In order to leave comments, you need to log in
How to filter by array?
Hello, I have such a problem. An array of strings comes to me:
[ 'TMNG', 'SA' ]
In the database, I have a column conditionally "short_name". I need to return data that has either "TMNG" or "SA" in this column. Here is my code:
const getSystemsForStatisticsPage = require('../models/Allocation');
module.exports.getSystemsForStatisticsPage = async (req, res) => {
console.log(req.body.el) <--- [ 'TMNG', 'SA' ]
if (req.body.el !== null) {
try {
const arr = await getSystemsForStatisticsPage.findAll({
where: {
short_name: req.body.el,
}
})
res.status(201).json(arr);
} catch (e) {
console.log(e)
res.status(500).json({
message: 'Server ERROR!'
})
}
} else {
res.status(201).json([]);
}
}
Answer the question
In order to leave comments, you need to log in
Most likely from a space character between inline-block elements.
If you have two divs that have display:inline-block, then try to arrange them in the code like this:
or like this
<div>...</div><!--
--><div>...</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question