A state plugin for netiam
npm i -S netiam netiam-contrib-state
netiam({plugins})
.rest({model: User})
.state.res({
map: [
{
base: Component,
state: UserComponent,
baseField: 'componentId',
userField: 'owner'
},
{
base: Campaign,
state: UserCampaign,
baseField: 'campaignId',
userField: 'owner'
},
{
base: Node,
state: UserNode,
baseField: 'nodeId',
userField: 'owner'
}
]
})
.json()