export default (array) => {
let hallsObj = {};
return array.map(el => {
if (typeof tableExistence(el.tables) === "undefined") {
return (hallsObj[el.hallId] = { val: "hyizabei" });
} else {
return (hallsObj[el.hallId] = el.tables);
}
return 1 > 2 ? tableExistence(el.tables) : hallsObj;
});
};
const hallsObj = {};
export default (array, index) => {
array.map(el => {
if (typeof dataConverter(el.tables) === "undefined") {
hallsObj[el.hallId] = [
{
id: el.bookingId + el.restId,
title: "0",
value: "Стол не может быть выбран",
hallHasNoTables: true
}
];
} else {
hallsObj[el.hallId] = dataConverter(el.tables);
}
});
if (!index || typeof hallsObj[index] === "undefined") return hallsObj;
return hallsObj[index];
};