adminarchitect / core

AdminArchitect - Active Admin for Laravel
http://adminarchitect.com
MIT License
211 stars 66 forks source link

wrong redirect after deleting from view page #67

Closed zoryamba closed 5 years ago

zoryamba commented 5 years ago

Hi. Thank you for your work. Admin architect is a great tool.

Just faced an issue after deleting record from view page in ScaffoldController there are lines:

        if (URL::previous() === route('scaffold.view', ['module' => $module, 'id' => $id])) {
            return back()->with('messages', [$message]);
        }

so when deleting from view page, user gets redirect back to view page. as i understand, it works correct when record is soft deleted. but if model doesn't support soft delete - user gets 404 error

am i missing something?

endihunter commented 5 years ago

@zoryamba hey, thanks for reporting the issue. You're right, there is no reason to redirect back to view resource page until the softDelete case is handled. For now, I think it's enough to redirect back to the index page.

endihunter commented 5 years ago

An update submitted, you can update the package.