HOR-158 "Implementar el nuevo endpoint para las grillas de mobile" SOLVED
Issue:
Implementar el nuevo endpoint para las grillas de mobile
Cause:
Requerimiento de nuevos end-points para Grids
Solution:
Se han implementado los siguientes end-points:
GET /api/1.0/{workspace}/project/{prj_uid}/dynaform/{dyn_uid}/grid/{grd_name}/field-definitions
GET /api/1.0/{workspace}/project/{prj_uid}/dynaform/{dyn_uid}/grid/{grd_name}/field-definition/{fld_id}
GET /api/1.0/{workspace}/case/{app_uid}/{del_index}/variable/{var_name}
GET /api/1.0/{workspace}/case/{app_uid}/{del_index}/variable/{var_name}/paged
POST /api/1.0/{workspace}/case/{app_uid}/{del_index}/variable/{var_name}
PUT /api/1.0/{workspace}/case/{app_uid}/{del_index}/variable/{var_name}
DELETE /api/1.0/{workspace}/case/{app_uid}/{del_index}/variable/{var_name}
This commit is contained in:
@@ -374,5 +374,38 @@ class Validator
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate pager data
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
* @param array $arrayVariableNameForException Variable name for exception
|
||||
*
|
||||
* @return mixed Returns TRUE when pager data is valid, Message Error otherwise
|
||||
*/
|
||||
public static function validatePagerDataByPagerDefinition($arrayPagerData, $arrayVariableNameForException)
|
||||
{
|
||||
try {
|
||||
foreach ($arrayPagerData as $key => $value) {
|
||||
$nameForException = (isset($arrayVariableNameForException[$key]))?
|
||||
$arrayVariableNameForException[$key] : $key;
|
||||
|
||||
if (!is_null($value) &&
|
||||
(
|
||||
(string)($value) == '' ||
|
||||
!preg_match('/^(?:\+|\-)?(?:0|[1-9]\d*)$/', $value . '') ||
|
||||
(int)($value) < 0
|
||||
)
|
||||
) {
|
||||
return \G::LoadTranslation('ID_INVALID_VALUE_EXPECTING_POSITIVE_INTEGER', [$nameForException]);
|
||||
}
|
||||
}
|
||||
|
||||
//Return
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user