Skip to content
Snippets Groups Projects
Commit 85409c34 authored by Victor Picussa's avatar Victor Picussa
Browse files

[v1.9.3]New fix

parent 31413558
No related branches found
No related tags found
1 merge request!179[v1.9.3]New fix
Pipeline #19660 failed
......@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## 1.9.3 - 2019-03-12
## Changed
- Fix addMissing function
## 1.9.2 - 2019-02-20
## Changed
- Fix location variable in table
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function addMissing(rqf){
return (req, res, next) => {
let dims = Object.keys(req.dims).filter(i => {return i !== 'size';});
......@@ -7,6 +27,7 @@ module.exports = function addMissing(rqf){
if(req.result.length === 0) return next();
let result = req.result;
let dimsValues = {};
result.forEach((r) => {
dims.forEach((dim) => {
......@@ -54,7 +75,7 @@ module.exports = function addMissing(rqf){
if(r[rqfName] > newEntry[rqfName]) break;
if(r[rqfName] == newEntry[rqfName] && r[rqfName2] > newEntry[rqfName2]) break;
}
if (newEntry.dim1Value != undefined && newEntry.dim2Value != undefined) {
if (newEntry.dim1Value == undefined && newEntry.dim2Value == undefined) {
let newResult = [...result.slice(0, index), newEntry, ...result.slice(index, result.length)];
result = newResult;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment