Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
fix: fix reminders (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaiss committed Jul 22, 2022
1 parent 7cc1cc1 commit 132c106
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public static function data(Vault $vault, User $user): Collection
$reminder = ContactReminder::where('id', $contactReminderScheduled->contact_reminder_id)->with('contact')->first();
$contact = $reminder->contact;

if ($contact->vault_id !== $vault->id) {
continue;
}

$remindersCollection->push([
'id' => $reminder->id,
'label' => $reminder->label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public static function upcomingReminders(Vault $vault, User $user): array
$reminder = ContactReminder::where('id', $contactReminderScheduled->contact_reminder_id)->with('contact')->first();
$contact = $reminder->contact;

if ($contact->vault_id !== $vault->id) {
continue;
}

$scheduledAtDate = Carbon::createFromFormat('Y-m-d H:i:s', $contactReminderScheduled->scheduled_at);

$remindersCollection->push([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<div v-if="data.reminders.length > 0">
<ul class="mb-4 rounded-lg border border-gray-200 bg-white">
<li
v-for="reminder in data"
v-for="reminder in data.reminders"
:key="reminder.id"
class="item-list border-b border-gray-200 px-3 py-2 hover:bg-slate-50">
<div class="flex items-center">
Expand Down

0 comments on commit 132c106

Please sign in to comment.