export function homePageProfileAction(list, name) {
return (dispatch) => {
dispatch(homePageProfileFetchId(list, name));
let promise = list.map(v => {
return getUserHome(v);
});
Promise.all(promise)
.then((ids) => {
console.log(ids);
//dispatch(homePageProfileFetchSuccess(res, "top"));
})
.catch(err => {console.log(err); });
};
}
var array = [];
function load_reservation(stock, year, month, callback) {
$.post("'.Url::to(['site/ajax-load-reservation']).'", {"stock": stock, "year": year, "month": month}, function (data) {
if (data.result == 1) {
callback(data.array);
}
else callback([]);
}, "json");
}
$(".book").each(function () {
var id = $(this).attr("data-stock_id");
load_reservation(id, null, null, function (result) {
array[id] = result;
console.log(array[id]);
});
});
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
proxy: {
'/api/*': {
target: 'http://127.0.0.1:8000', // server with api
secure: false
}
},
}).listen(4000, 'localhost', function(err) {
if (err) {
console.log(err);
}
console.log('Listening at localhost:4000');
});