Signed-off-by: Edaly Ahmed <ahmed.edaly@oyez.fr>

signing off
This commit is contained in:
Edaly Ahmed 2020-02-13 12:30:26 +01:00
parent 9c68285594
commit 67f4712fa7

View File

@ -55,7 +55,7 @@ module.exports = {
const buffers = await uploadService.bufferize(files);
const enhancedFiles = buffers.map(file => {
if (file.size > config.sizeLimit) {
if (parseFloat(file.size) > parseFloat(config.sizeLimit)) {
return ctx.badRequest(null, [
{
messages: [
@ -208,10 +208,9 @@ const searchQueries = {
return ({ id }) => {
return model
.query(qb => {
qb.whereRaw('LOWER(hash) LIKE ?', [`%${id}%`]).orWhereRaw(
'LOWER(name) LIKE ?',
[`%${id}%`]
);
qb.whereRaw('LOWER(hash) LIKE ?', [
`%${id}%`,
]).orWhereRaw('LOWER(name) LIKE ?', [`%${id}%`]);
})
.fetchAll()
.then(results => results.toJSON());