Closed 77media-creations closed 1 year ago
Hi, noticed there hasn't been many answers to questions on issues - I'm just wondering if you've gotten your issue resolved?
I agree that it should work something like the SubscribersController. Happy to accept a PR
I agree that it should work something like the SubscribersController. Happy to accept a PR
Glad to hear there are still contributors active in the repo that have committed. Looking forward to growing and contributing this installation - I like SendPortal's simplicity. Thank you for responding.
Using the latest version 2.
Issue
Updating a subscriber via API doesn't update column 'unsubscribe_event_id' and which causes the following error when visiting the (same) subscriber edit page via UI.
TypeError
Sendportal\Base\Models\UnsubscribeEventType::findById(): Return value must be of type string, array returned (View: /Users/sohal/SynologyDrive/Dropbox/Coding/laravel/sendportal/vendor/mettle/sendportal-core/resources/views/subscribers/show.blade.php)
How to reproduce?
unsubscribed_at' => now()
with the request.Upon digging deeper, I found that the methods
storeOrUpdate()
andupdate()
do not set any value for the columnunsubscribe_event_id
and leave itNULL
which is supposed to be a requiredINT
value to be able to show the subscriber edit page when theunsubscribed_at
has a date value set.Possible fix.
Similar to
Sendportal\Base\Http\Controllers\Subscribers\SubscribersController.php
, a check should be implemented before unsubscribing in theApi/SubscribersController.php
file.