Skip to content

Commit

Permalink
index dispatched email table
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganes556 committed Feb 20, 2025
1 parent 73472f0 commit 51f4e53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions app/Actions/Comms/Outbox/UI/ShowOutbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 51f4e53

Please sign in to comment.