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

Notification when overriding a default route #625

Open
jjf21 opened this issue Jun 13, 2023 · 1 comment
Open

Notification when overriding a default route #625

jjf21 opened this issue Jun 13, 2023 · 1 comment

Comments

@jjf21
Copy link

jjf21 commented Jun 13, 2023

Expected behavior

When overriding a route, I can't edit the success notification:

Actual behavior

Here is my code:

# lib/forest_liana/controllers/organizations_controller.rb
if ForestLiana::UserSpace.const_defined?("OrganizationController")
  ForestLiana::UserSpace::OrganizationController.class_eval do

    def destroy
      organization_id = params[:id]
      Organizations::DestroyWorker.perform_async(organization_id)
      render status: 200, json: { success: "The organization #{organization_id} will be deleted soon!" }
    end

end

I always get "Organization deleted!" as notification

I've tried several way to render a success messages but non of them worked
render status: 200, plain: success_message
render status: 201, html: success_message

In smart actions it says : render json: { success: success_message }

Thanks for you help !

forest_liana (7.6.7)

@matthv
Copy link
Member

matthv commented Jun 13, 2023

Hello @jjf21,

Sadly, this as already been reported (https://community.forestadmin.com/t/how-to-set-the-message-of-the-banner-red-green-blue-returned-to-the-ui-on-action-completion/3337/1) and it's not supported.
The way we handle error code/messages is pretty generic accross the application and we currently do not handle such customization on CRUD routes.
I'm pushing your request to our product board, and be sure we will ping you when we'll tackle this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants