PMCORE-3232 Service /api/1.0/workflow/home/config/1/test return 400 if there is not this setting
This commit is contained in:
@@ -34,10 +34,14 @@ class UserConfig extends Model
|
||||
if (empty($userConfig)) {
|
||||
return null;
|
||||
}
|
||||
$setting = json_decode($userConfig->USC_SETTING);
|
||||
if (empty($setting)) {
|
||||
$setting = new stdClass();
|
||||
}
|
||||
return [
|
||||
"id" => $userConfig->USR_ID,
|
||||
"name" => $userConfig->USC_NAME,
|
||||
"setting" => json_decode($userConfig->USC_SETTING)
|
||||
"setting" => $setting
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -904,7 +904,10 @@ class Home extends Api
|
||||
{
|
||||
$setting = UserConfig::getSetting($id, $name);
|
||||
if (is_null($setting)) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, G::LoadTranslation('ID_DOES_NOT_EXIST'));
|
||||
$setting = [
|
||||
"status" => 404,
|
||||
"message" => G::LoadTranslation('ID_DOES_NOT_EXIST')
|
||||
];
|
||||
}
|
||||
return $setting;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user