getRefresh #
Available since 2.11.0
Gets the refresh value.
Returns defaultValue if the refresh argument is not set, 'false' if it is false, 'false' or null, and 'wait_for' for any other value.
Arguments #
getRefresh (defaultValue: 'false' | 'wait_for' = 'false'): 'false' | 'wait_for'| Name | Type | Description |
|---|---|---|
defaultValue | 'false' | 'wait_for' | Default value to return if the parameter is not set |
Example #
const refresh = request.getRefresh();
// equivalent
const refresh = request.input.args.refresh;
//+ checks to make sure that "refresh" is of the right type
// and throw standard API error when it's not the case