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];
};