Corrected issue with table view and duplicate appointments

This commit is contained in:
Alex Tselegidis 2020-12-08 10:17:24 +02:00
parent 8f2487865f
commit 9655feca6c
2 changed files with 5 additions and 5 deletions

View File

@ -83,11 +83,11 @@ class Backend_api extends EA_Controller {
])
];
foreach ($response['appointments'] as &$appointment)
foreach ($response['appointments'] as $index => $appointment)
{
$appointment['provider'] = $this->providers_model->get_row($appointment['id_users_provider']);
$appointment['service'] = $this->services_model->get_row($appointment['id_services']);
$appointment['customer'] = $this->customers_model->get_row($appointment['id_users_customer']);
$response['appointments'][$index]['provider'] = $this->providers_model->get_row($appointment['id_users_provider']);
$response['appointments'][$index]['service'] = $this->services_model->get_row($appointment['id_services']);
$response['appointments'][$index]['customer'] = $this->customers_model->get_row($appointment['id_users_customer']);
}
$user_id = $this->session->userdata('user_id');

View File

@ -71,7 +71,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
var endDate = endDateMoment.toDate();
getCalendarEvents(startDate, endDate)
.done(function () {
.done(function (response) {
var currentDate = startDate;
while (currentDate <= endDate) {