getMainAct
getMainAct: (schema: string, actName: string)
Get specific Dynamic Action of main service with schemaName and actName
Example
const cities = coreApp.odm.newModel("city", locationPure, {});
const setAddCityAct = coreApp.acts.setAct({
schema: "city",
actName: "addCity",
validator: addCityValidator(),
fn: addCity,
});
const getMainAct = coreApp.acts.getMainAct("city", "addCity");
Return Of Example
{
"validator": {
"type": "object",
"schema": {
"set": {
"type": "object",
"schema": {
"name": {
"type": "string",
"schema": null
},
"population": {
"type": "number",
"schema": null
},
"abb": {
"type": "string",
"schema": null
},
"isCapital": {
"type": "boolean",
"schema": null
},
"country": {
"type": "union",
"schema": null
}
}
},
"get": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"population": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"abb": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"country": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"population": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"abb": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
}
}
},
"users": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"age": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
}
}
},
"lovedByUser": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"age": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
}
}
}
}
}
}
},
"validationRunType": "assert"
}
Parameters
schema: string,
actName: string