I am trying to add a Ajax Alert or popup message inside a hook_node_presave or hook_node_update, but it is not working.
My current code look like this, but I have tried a lot of other ajax
$response = new ajaxResponse(); $response->addCommand(new AlertCommand('Ajax test')); return $response;
The node is saved but no alert and no errors in the console. Drupal 9