upsertModelResources

Function

Takes an IModel and an array of resources and upserts them to the backing item. Then searches for the resources that were upserted and attaches them to the model, which is returned.

  • upsertModelResources(model: IModel, resources: Array<{
    filename:
    string
    resource:
    Record<stringany>
    }>
    , requestOptions: IUserRequestOptions) : Promise<IModel>

Parameters

Parameter Type Default Notes
model Required IModel
resources Required Array<{
filename:
string
resource:
Record<stringany>
}>
requestOptions Required IUserRequestOptions

Available requestOptions

Property Type Notes

Returns

{Promise}

Promise<IModel>
Property Type Notes
item IItem
data Optional [key: string]: any
resources Optional [key: string]: any

Function defined in common/src/models/index.ts:184