Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting hook always shows success #97

Open
stebogit opened this issue Sep 8, 2023 · 1 comment
Open

Deleting hook always shows success #97

stebogit opened this issue Sep 8, 2023 · 1 comment
Labels
fixed in dev branch Fixed development branch will be in next release

Comments

@stebogit
Copy link

stebogit commented Sep 8, 2023

Describe the bug
It seems the deleting hook does not shows an error in case of unsuccessful result, though the actual delete action is prevented. In addition, the page is always redirected back to the list view after clicking on the 'OK' button.

To Reproduce

$form->deleting(function (Form $form, $id) {
    throw new Exception('You can\'t delete the model.');
    // or even this doesn't work
    return response()->json([
        'status'  => false,
        'message' => 'You can\'t delete the model.',
    ], 400);
});

Screen Shot 2023-09-08 at 2 28 21 AM

Expected behavior
I would expect an error message and the page not to redirect to the list.

System

  • Open-admin version 1.0.27
  • PHP version 7.4
  • Laravel Version 8
  • OS: Mac
  • Browser chrome
open-admin-org added a commit that referenced this issue Nov 8, 2023
@open-admin-org open-admin-org added the fixed in dev branch Fixed development branch will be in next release label Nov 8, 2023
@open-admin-org
Copy link
Owner

Thanks for reporting @stebogit now fixed in dev branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in dev branch Fixed development branch will be in next release
Projects
None yet
Development

No branches or pull requests

2 participants