Adding tags was creating this nested array structure which was causing buggy behavior. This should fix that.

This commit is contained in:
Michael Abashian 2017-01-26 17:36:51 -05:00
parent bfda6ff8b5
commit f7f92c961d

View File

@ -212,7 +212,15 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', '
params.page = '1';
queryset = _.merge(queryset, params, (objectValue, sourceValue, key, object) => {
if (object[key] && object[key] !== sourceValue){
return [object[key], sourceValue];
if(_.isArray(object[key])) {
// Add the new value to the array and return
object[key].push(sourceValue);
return object[key];
}
else {
// Start the array of keys
return [object[key], sourceValue];
}
}
else {
// // https://lodash.com/docs/3.10.1#merge