RickDBCN / filament-email

Log emails in your Filament project
https://filament-email-demo.marcogermani.it/
MIT License
87 stars 24 forks source link

[Bug]: #23

Closed torriv83 closed 1 year ago

torriv83 commented 1 year ago

What happened?

As stated in the discord chat a while back, the Bulk action does not delete.

How to reproduce the bug

I check all the emails i want to delete, choose bulk action, and then delete. i get a message saying that the records are successfully deleted. but they are not.

Package Version

1.0.7

PHP Version

8.2.0

Laravel Version

10.28.0

Which operating systems does with happen with?

No response

Notes

No response

RickDBCN commented 1 year ago

Hi Torri,

I need some more time to reproduce this, as I'm unable to reproduce. I'll get back to you asap.

quasiperfect commented 1 year ago

i think i can fix this in the weekend or if is urgent anyone can pr

here https://github.com/RickDBCN/filament-email/blob/main/src/Filament/Resources/EmailResource.php#L159 we need to add something like ->action(fn (Collection $records) => $records->each->delete()), see here https://filamentphp.com/docs/3.x/tables/actions#bulk-actions

RickDBCN commented 1 year ago

Hmm, I'm confident that the BulkDeleteAction should automatically include the delete for each record. Will need to check.

quasiperfect commented 1 year ago

@RickDBCN if you remove ->action(function () { Notification::make() ->title('Emails succesfully deleted') ->success() ->send(); }), i think it will work ok. the bulk action already sends a notification

torriv83 commented 1 year ago

I can confirm that removing the ->action resolves this bug for me. I have never done a PR before, so i'm not sure the step to make a PR.

torriv83 commented 1 year ago

I tried making a PR. hopefully it works :)

RickDBCN commented 1 year ago

I tried making a PR. hopefully it works :)

It did, thanks!