Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: null reference on gift photo upload (#5547)
Attempting to connect a photo to a gift, either an already existing one or a freshly uploaded one, the AJAX call would return a 500 server error. The error states of a `Attempt to read property "id" on null` in `app\Http\Resources\Gift/Gift` line 24. This is causes by attempting to use a void result of `AssociatePhotoToGift` service in `ApiGiftController::associate()` method. Fixed by returning the actual `$gift` variable worked on, similar to the related services. This does fix the *stacktrace* in #5516, but not the issue itself. The issue there is likely unrelated to the stacktrace. Fixes #5397
- Loading branch information