getModelFromOptions
To streamline passing of either a model id or the model itself, we use this function
to extract the model or fetch it, and return it. It uses failSafe
and if the item
is not accessible for whatever reason, will return a model-ish object with isMissing: true
It is up to the caller to take approriate action
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
modelType Required | string |
the type of model to extract from the options hash |
|
options Required | Record<stringany> |
Something that extends IRequestOptions |
Returns
Function defined in common/src/items/get-model-from-options.ts:13