diff --git a/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php b/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php index a99bb5a55c..bc4090cde9 100644 --- a/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php +++ b/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php @@ -38,7 +38,7 @@ public function handle(Group|Mailshot|Outbox|PostRoom|Organisation|Shop $parent, { $globalSearch = AllowedFilter::callback('global', function ($query, $value) { $query->where(function ($query) use ($value) { - $query->orWhereWith('dispatched_emails.email_address', $value); + $query->orWhereWith('email_addresses.email', $value); }); }); @@ -96,7 +96,7 @@ public function handle(Group|Mailshot|Outbox|PostRoom|Organisation|Shop $parent, $query->where('dispatched_emails.group_id', $parent->id); } }) - ->allowedSorts(['dispatched_emails.state', 'sent_at' ,'dispatched_emails.number_reads', 'mask_as_spam' ,'dispatched_emails.number_clicks']) + ->allowedSorts(['email_address', 'sent_at' ,'number_reads', 'mask_as_spam' ,'number_clicks']) ->allowedFilters([$globalSearch]) ->withPaginator($prefix, tableName: request()->route()->getName()) ->withQueryString(); diff --git a/app/Actions/Comms/Outbox/UI/ShowOutbox.php b/app/Actions/Comms/Outbox/UI/ShowOutbox.php index 9ba4c5d70a..5a33abb370 100644 --- a/app/Actions/Comms/Outbox/UI/ShowOutbox.php +++ b/app/Actions/Comms/Outbox/UI/ShowOutbox.php @@ -152,12 +152,12 @@ public function htmlResponse(Outbox $outbox, ActionRequest $request): Response : Inertia::lazy(fn () => GetOutboxShowcase::run($outbox)), OutboxTabsEnum::MAILSHOTS->value => $this->tab == OutboxTabsEnum::MAILSHOTS->value ? - fn () => MailshotResource::collection(IndexMailshots::run($outbox)) - : Inertia::lazy(fn () => MailshotResource::collection(IndexMailshots::run($outbox))), + fn () => MailshotResource::collection(IndexMailshots::run($outbox, OutboxTabsEnum::MAILSHOTS->value)) + : Inertia::lazy(fn () => MailshotResource::collection(IndexMailshots::run($outbox, OutboxTabsEnum::MAILSHOTS->value))), OutboxTabsEnum::DISPATCHED_EMAILS->value => $this->tab == OutboxTabsEnum::DISPATCHED_EMAILS->value ? - fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox)) - : Inertia::lazy(fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox))), + fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox, OutboxTabsEnum::DISPATCHED_EMAILS->value)) + : Inertia::lazy(fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox, OutboxTabsEnum::DISPATCHED_EMAILS->value))), // OutboxTabsEnum::EMAIL_BULK_RUNS->value => $this->tab == OutboxTabsEnum::EMAIL_BULK_RUNS->value ? // fn () => EmailBulkRunsResource::collection(IndexEmailBulkRuns::run($outbox))