Skip to content

Commit 2b69e8f

Browse files
Correct duplicate event validation during google syncing
1 parent 06dba1c commit 2b69e8f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

application/controllers/Google.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,18 @@ public static function sync(?string $provider_id = null): void
224224
$google_event_end = new DateTime($google_event->getEnd()->getDateTime());
225225
$google_event_end->setTimezone($provider_timezone);
226226

227-
$appointment_results = $CI->appointments_model->get(['id_google_calendar' => $google_event->getId()]);
227+
$appointment_results = $CI->appointments_model->get([
228+
'id_google_calendar' => $google_event->getId(),
229+
'id_users_provider' => $provider_id,
230+
]);
228231

229232
if (!empty($appointment_results)) {
230233
continue;
231234
}
232235

233236
$unavailability_results = $CI->unavailabilities_model->get([
234237
'id_google_calendar' => $google_event->getId(),
238+
'id_users_provider' => $provider_id,
235239
]);
236240

237241
if (!empty($unavailability_results)) {

0 commit comments

Comments
 (0)