Fix Mattermost plugin config

This commit is contained in:
Alfredo Cardigliano 2023-03-10 17:11:11 +01:00
parent e6f6189485
commit cfa4c519bd
3 changed files with 23 additions and 27 deletions

View file

@ -236,20 +236,20 @@ function endpoints.add_config(endpoint_key, endpoint_conf_name, endpoint_params)
-- Is the config already existing?
local is_existing, existing_conf = is_endpoint_config_existing(endpoint_conf_name)
if is_existing then
return {status = "failed",
endpoint_id = existing_conf.endpoint_id,
endpoint_conf_name = existing_conf.endpoint_conf_name,
return {
status = "failed",
endpoint_id = existing_conf.endpoint_id,
endpoint_conf_name = existing_conf.endpoint_conf_name,
error = {
type = "endpoint_config_already_existing",
endpoint_conf_name = existing_conf.endpoint_conf_name,
}
error = {
type = "endpoint_config_already_existing",
endpoint_conf_name = existing_conf.endpoint_conf_name,
}
}
end
-- Are the submitted params those expected by the endpoint?
ok, status = check_endpoint_config_params(endpoint_key, endpoint_params)
if not ok then
return status
end