ui_report: Reuse channel.xhr_error_message function in error method.

We should reuse the `channel.xhr_error_message` in `ui_report` to reduce
code duplication.

Also, I changed the type of `message` parameter to `string` instead of
`string | null` so that we do not need to alter the types of the functions
that depends on the return value of `xhr_error_message`.
This commit is contained in:
Lalit Kumar Singh
2023-08-30 15:38:32 +05:30
committed by Tim Abbott
parent 2e07c03968
commit cfe2ddb091
4 changed files with 6 additions and 19 deletions

View File

@@ -1032,7 +1032,7 @@ export function save_message_row_edit($row) {
}
hide_message_edit_spinner($row);
const message = channel.xhr_error_message(null, xhr);
const message = channel.xhr_error_message("", xhr);
const $container = compose_banner.get_compose_banner_container(
$row.find("textarea"),
);